Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / canvas / WebGLCompressedTextureETC1.cpp
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6
7 #include "core/html/canvas/WebGLCompressedTextureETC1.h"
8
9 #include "core/html/canvas/WebGLRenderingContextBase.h"
10
11 namespace blink {
12
13 WebGLCompressedTextureETC1::WebGLCompressedTextureETC1(WebGLRenderingContextBase* context)
14     : WebGLExtension(context)
15 {
16     ScriptWrappable::init(this);
17     context->addCompressedTextureFormat(GL_ETC1_RGB8_OES);
18 }
19
20 WebGLCompressedTextureETC1::~WebGLCompressedTextureETC1()
21 {
22 }
23
24 WebGLExtensionName WebGLCompressedTextureETC1::name() const
25 {
26     return WebGLCompressedTextureETC1Name;
27 }
28
29 PassRefPtrWillBeRawPtr<WebGLCompressedTextureETC1> WebGLCompressedTextureETC1::create(WebGLRenderingContextBase* context)
30 {
31     return adoptRefWillBeNoop(new WebGLCompressedTextureETC1(context));
32 }
33
34 bool WebGLCompressedTextureETC1::supported(WebGLRenderingContextBase* context)
35 {
36     Extensions3DUtil* extensionsUtil = context->extensionsUtil();
37     return extensionsUtil->supportsExtension("GL_OES_compressed_ETC1_RGB8_texture");
38 }
39
40 const char* WebGLCompressedTextureETC1::extensionName()
41 {
42     return "WEBGL_compressed_texture_etc1";
43 }
44
45 } // namespace blink