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