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 13 matching lines...) Expand all Loading... |
24 {GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10}, | 24 {GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10}, |
25 {GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10}, | 25 {GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10}, |
26 {GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12}}; | 26 {GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12}}; |
27 | 27 |
28 WebGLCompressedTextureASTC::WebGLCompressedTextureASTC(WebGLRenderingContextBase
* context) | 28 WebGLCompressedTextureASTC::WebGLCompressedTextureASTC(WebGLRenderingContextBase
* context) |
29 : WebGLExtension(context) | 29 : WebGLExtension(context) |
30 { | 30 { |
31 const int kAlphaFormatGap = | 31 const int kAlphaFormatGap = |
32 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR - GL_COMPRESSED_RGBA_ASTC_4x4_KH
R; | 32 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR - GL_COMPRESSED_RGBA_ASTC_4x4_KH
R; |
33 | 33 |
34 for (size_t i = 0; i < arraysize(WebGLCompressedTextureASTC::kBlockSizeCompr
essASTC); i++) { | 34 for (size_t i = 0; i < WTF_ARRAY_LENGTH(WebGLCompressedTextureASTC::kBlockSi
zeCompressASTC); i++) { |
35 /* GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD) */ | 35 /* GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD) */ |
36 context->addCompressedTextureFormat( | 36 context->addCompressedTextureFormat( |
37 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType); | 37 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType); |
38 /* GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD) */ | 38 /* GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD) */ |
39 context->addCompressedTextureFormat( | 39 context->addCompressedTextureFormat( |
40 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType +
kAlphaFormatGap); | 40 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType +
kAlphaFormatGap); |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 WebGLCompressedTextureASTC::~WebGLCompressedTextureASTC() | 44 WebGLCompressedTextureASTC::~WebGLCompressedTextureASTC() |
(...skipping 16 matching lines...) Expand all Loading... |
61 return extensionsUtil->supportsExtension("GL_KHR_texture_compression_astc_ld
r"); | 61 return extensionsUtil->supportsExtension("GL_KHR_texture_compression_astc_ld
r"); |
62 } | 62 } |
63 | 63 |
64 const char* WebGLCompressedTextureASTC::extensionName() | 64 const char* WebGLCompressedTextureASTC::extensionName() |
65 { | 65 { |
66 // TODO(cyzero.kim): implement extension for GL_KHR_texture_compression_astc
_hdr. | 66 // TODO(cyzero.kim): implement extension for GL_KHR_texture_compression_astc
_hdr. |
67 return "WEBGL_compressed_texture_astc"; | 67 return "WEBGL_compressed_texture_astc"; |
68 } | 68 } |
69 | 69 |
70 } // namespace blink | 70 } // namespace blink |
OLD | NEW |