| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/webgl/WebGLCompressedTextureASTC.h" | 5 #include "modules/webgl/WebGLCompressedTextureASTC.h" |
| 6 | 6 |
| 7 #include "modules/webgl/WebGLRenderingContextBase.h" | 7 #include "modules/webgl/WebGLRenderingContextBase.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 /* GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD) */ | 37 /* GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD) */ |
| 38 context->addCompressedTextureFormat( | 38 context->addCompressedTextureFormat( |
| 39 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType); | 39 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType); |
| 40 /* GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD) */ | 40 /* GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD) */ |
| 41 context->addCompressedTextureFormat( | 41 context->addCompressedTextureFormat( |
| 42 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType + | 42 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType + |
| 43 kAlphaFormatGap); | 43 kAlphaFormatGap); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 WebGLCompressedTextureASTC::~WebGLCompressedTextureASTC() {} | |
| 48 | |
| 49 WebGLExtensionName WebGLCompressedTextureASTC::name() const { | 47 WebGLExtensionName WebGLCompressedTextureASTC::name() const { |
| 50 return WebGLCompressedTextureASTCName; | 48 return WebGLCompressedTextureASTCName; |
| 51 } | 49 } |
| 52 | 50 |
| 53 WebGLCompressedTextureASTC* WebGLCompressedTextureASTC::create( | 51 WebGLCompressedTextureASTC* WebGLCompressedTextureASTC::create( |
| 54 WebGLRenderingContextBase* context) { | 52 WebGLRenderingContextBase* context) { |
| 55 return new WebGLCompressedTextureASTC(context); | 53 return new WebGLCompressedTextureASTC(context); |
| 56 } | 54 } |
| 57 | 55 |
| 58 bool WebGLCompressedTextureASTC::supported(WebGLRenderingContextBase* context) { | 56 bool WebGLCompressedTextureASTC::supported(WebGLRenderingContextBase* context) { |
| 59 Extensions3DUtil* extensionsUtil = context->extensionsUtil(); | 57 Extensions3DUtil* extensionsUtil = context->extensionsUtil(); |
| 60 return extensionsUtil->supportsExtension( | 58 return extensionsUtil->supportsExtension( |
| 61 "GL_KHR_texture_compression_astc_ldr"); | 59 "GL_KHR_texture_compression_astc_ldr"); |
| 62 } | 60 } |
| 63 | 61 |
| 64 const char* WebGLCompressedTextureASTC::extensionName() { | 62 const char* WebGLCompressedTextureASTC::extensionName() { |
| 65 // TODO(cyzero.kim): implement extension for | 63 // TODO(cyzero.kim): implement extension for |
| 66 // GL_KHR_texture_compression_astc_hdr. | 64 // GL_KHR_texture_compression_astc_hdr. |
| 67 return "WEBGL_compressed_texture_astc"; | 65 return "WEBGL_compressed_texture_astc"; |
| 68 } | 66 } |
| 69 | 67 |
| 70 } // namespace blink | 68 } // namespace blink |
| OLD | NEW |