Index: third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLDepthTexture.cpp b/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp |
similarity index 55% |
copy from third_party/WebKit/Source/modules/webgl/WebGLDepthTexture.cpp |
copy to third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp |
index 17b3319638dd8a6e8eda386a02e1ed7dff0c5d93..5bc853ebd8361d61b222309acfa2ad66ccb0cf0b 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGLDepthTexture.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2012 Google Inc. All rights reserved. |
+ * Copyright (C) 2016 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
@@ -23,46 +23,44 @@ |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#include "modules/webgl/WebGLDepthTexture.h" |
+#include "modules/webgl/WebGLCompressedTextureS3TCsRGB.h" |
+ |
+#include "modules/webgl/WebGLRenderingContextBase.h" |
namespace blink { |
-WebGLDepthTexture::WebGLDepthTexture(WebGLRenderingContextBase* context) |
+WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB(WebGLRenderingContextBase* context) |
: WebGLExtension(context) |
{ |
- context->extensionsUtil()->ensureExtensionEnabled("GL_CHROMIUM_depth_texture"); |
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_S3TC_DXT1_NV); |
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV); |
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV); |
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV); |
} |
-WebGLDepthTexture::~WebGLDepthTexture() |
+WebGLCompressedTextureS3TCsRGB::~WebGLCompressedTextureS3TCsRGB() |
{ |
} |
-WebGLExtensionName WebGLDepthTexture::name() const |
+WebGLExtensionName WebGLCompressedTextureS3TCsRGB::name() const |
{ |
- return WebGLDepthTextureName; |
+ return WebGLCompressedTextureS3TCsRGBName; |
} |
-WebGLDepthTexture* WebGLDepthTexture::create(WebGLRenderingContextBase* context) |
+WebGLCompressedTextureS3TCsRGB* WebGLCompressedTextureS3TCsRGB::create(WebGLRenderingContextBase* context) |
{ |
- return new WebGLDepthTexture(context); |
+ return new WebGLCompressedTextureS3TCsRGB(context); |
} |
-bool WebGLDepthTexture::supported(WebGLRenderingContextBase* context) |
+bool WebGLCompressedTextureS3TCsRGB::supported(WebGLRenderingContextBase* context) |
{ |
Extensions3DUtil* extensionsUtil = context->extensionsUtil(); |
- // Emulating the UNSIGNED_INT_24_8_WEBGL texture internal format in terms |
- // of two separate texture objects is too difficult, so disable depth |
- // textures unless a packed depth/stencil format is available. |
- if (!extensionsUtil->supportsExtension("GL_OES_packed_depth_stencil")) |
- return false; |
- return extensionsUtil->supportsExtension("GL_CHROMIUM_depth_texture") |
- || extensionsUtil->supportsExtension("GL_OES_depth_texture") |
- || extensionsUtil->supportsExtension("GL_ARB_depth_texture"); |
+ return extensionsUtil->supportsExtension("GL_NV_sRGB_formats"); |
Ken Russell (switch to Gerrit)
2016/09/15 00:50:35
Let's add a TODO here, at least, about changing th
Kai Ninomiya
2016/09/15 20:45:35
Done.
|
} |
-const char* WebGLDepthTexture::extensionName() |
+const char* WebGLCompressedTextureS3TCsRGB::extensionName() |
{ |
- return "WEBGL_depth_texture"; |
+ return "WEBGL_compressed_texture_s3tc_srgb"; |
} |
} // namespace blink |