| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC( | 32 WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC( |
| 33 WebGLRenderingContextBase* context) | 33 WebGLRenderingContextBase* context) |
| 34 : WebGLExtension(context) { | 34 : WebGLExtension(context) { |
| 35 context->addCompressedTextureFormat(GL_COMPRESSED_RGB_S3TC_DXT1_EXT); | 35 context->addCompressedTextureFormat(GL_COMPRESSED_RGB_S3TC_DXT1_EXT); |
| 36 context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT); | 36 context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT); |
| 37 context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT); | 37 context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT); |
| 38 context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); | 38 context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); |
| 39 } | 39 } |
| 40 | 40 |
| 41 WebGLCompressedTextureS3TC::~WebGLCompressedTextureS3TC() {} | |
| 42 | |
| 43 WebGLExtensionName WebGLCompressedTextureS3TC::name() const { | 41 WebGLExtensionName WebGLCompressedTextureS3TC::name() const { |
| 44 return WebGLCompressedTextureS3TCName; | 42 return WebGLCompressedTextureS3TCName; |
| 45 } | 43 } |
| 46 | 44 |
| 47 WebGLCompressedTextureS3TC* WebGLCompressedTextureS3TC::create( | 45 WebGLCompressedTextureS3TC* WebGLCompressedTextureS3TC::create( |
| 48 WebGLRenderingContextBase* context) { | 46 WebGLRenderingContextBase* context) { |
| 49 return new WebGLCompressedTextureS3TC(context); | 47 return new WebGLCompressedTextureS3TC(context); |
| 50 } | 48 } |
| 51 | 49 |
| 52 bool WebGLCompressedTextureS3TC::supported(WebGLRenderingContextBase* context) { | 50 bool WebGLCompressedTextureS3TC::supported(WebGLRenderingContextBase* context) { |
| 53 Extensions3DUtil* extensionsUtil = context->extensionsUtil(); | 51 Extensions3DUtil* extensionsUtil = context->extensionsUtil(); |
| 54 return extensionsUtil->supportsExtension("GL_EXT_texture_compression_s3tc") || | 52 return extensionsUtil->supportsExtension("GL_EXT_texture_compression_s3tc") || |
| 55 (extensionsUtil->supportsExtension( | 53 (extensionsUtil->supportsExtension( |
| 56 "GL_EXT_texture_compression_dxt1") && | 54 "GL_EXT_texture_compression_dxt1") && |
| 57 extensionsUtil->supportsExtension( | 55 extensionsUtil->supportsExtension( |
| 58 "GL_CHROMIUM_texture_compression_dxt3") && | 56 "GL_CHROMIUM_texture_compression_dxt3") && |
| 59 extensionsUtil->supportsExtension( | 57 extensionsUtil->supportsExtension( |
| 60 "GL_CHROMIUM_texture_compression_dxt5")); | 58 "GL_CHROMIUM_texture_compression_dxt5")); |
| 61 } | 59 } |
| 62 | 60 |
| 63 const char* WebGLCompressedTextureS3TC::extensionName() { | 61 const char* WebGLCompressedTextureS3TC::extensionName() { |
| 64 return "WEBGL_compressed_texture_s3tc"; | 62 return "WEBGL_compressed_texture_s3tc"; |
| 65 } | 63 } |
| 66 | 64 |
| 67 } // namespace blink | 65 } // namespace blink |
| OLD | NEW |