Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(938)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureES30.cpp

Issue 2354713004: Implement WEBGL_compressed_texture_es3_0 extension for WebGL 1/2 (Closed)
Patch Set: fixup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureES30.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureES30.cpp b/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureES30.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6fe1a25d0aabbc30a5cd52fc98373e43a7bf226a
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureES30.cpp
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/webgl/WebGLCompressedTextureES30.h"
+
+#include "modules/webgl/WebGLRenderingContextBase.h"
+
+namespace blink {
+
+WebGLCompressedTextureES30::WebGLCompressedTextureES30(WebGLRenderingContextBase* context)
+ : WebGLExtension(context)
+{
+ context->addCompressedTextureFormat(GL_COMPRESSED_R11_EAC);
+ context->addCompressedTextureFormat(GL_COMPRESSED_SIGNED_R11_EAC);
+ context->addCompressedTextureFormat(GL_COMPRESSED_RGB8_ETC2);
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB8_ETC2);
+ context->addCompressedTextureFormat(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2);
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2);
+ context->addCompressedTextureFormat(GL_COMPRESSED_RG11_EAC);
+ context->addCompressedTextureFormat(GL_COMPRESSED_SIGNED_RG11_EAC);
+ context->addCompressedTextureFormat(GL_COMPRESSED_RGBA8_ETC2_EAC);
+ context->addCompressedTextureFormat(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC);
+}
+
+WebGLCompressedTextureES30::~WebGLCompressedTextureES30()
+{
+}
+
+WebGLExtensionName WebGLCompressedTextureES30::name() const
+{
+ return WebGLCompressedTextureES30Name;
+}
+
+WebGLCompressedTextureES30* WebGLCompressedTextureES30::create(WebGLRenderingContextBase* context)
+{
+ return new WebGLCompressedTextureES30(context);
+}
+
+bool WebGLCompressedTextureES30::supported(WebGLRenderingContextBase* context)
+{
+ Extensions3DUtil* extensionsUtil = context->extensionsUtil();
+ return extensionsUtil->supportsExtension("GL_CHROMIUM_compressed_texture_es3_0");
+}
+
+const char* WebGLCompressedTextureES30::extensionName()
+{
+ return "WEBGL_compressed_texture_es3_0";
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698