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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp

Issue 2337833002: Implement WEBGL_compressed_texture_s3tc_srgb (Closed)
Patch Set: add test and fix feature detection (enabled on webgl2, android/tegra) 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "modules/webgl/WebGLCompressedTextureS3TCsRGB.h"
6
7 #include "modules/webgl/WebGLRenderingContextBase.h"
8
9 namespace blink {
10
11 WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB(WebGLRenderingCon textBase* context)
12 : WebGLExtension(context)
13 {
14 // TODO(kainino): update these with _EXT versions once
15 // GL_EXT_compressed_texture_s3tc_srgb is ratified
16 context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_S3TC_DXT1_NV);
17 context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV);
18 context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV);
19 context->addCompressedTextureFormat(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV);
20 }
21
22 WebGLCompressedTextureS3TCsRGB::~WebGLCompressedTextureS3TCsRGB()
23 {
24 }
25
26 WebGLExtensionName WebGLCompressedTextureS3TCsRGB::name() const
27 {
28 return WebGLCompressedTextureS3TCsRGBName;
29 }
30
31 WebGLCompressedTextureS3TCsRGB* WebGLCompressedTextureS3TCsRGB::create(WebGLRend eringContextBase* context)
32 {
33 return new WebGLCompressedTextureS3TCsRGB(context);
34 }
35
36 bool WebGLCompressedTextureS3TCsRGB::supported(WebGLRenderingContextBase* contex t)
37 {
38 Extensions3DUtil* extensionsUtil = context->extensionsUtil();
39 return extensionsUtil->supportsExtension("GL_EXT_texture_compression_s3tc_sr gb");
40 }
41
42 const char* WebGLCompressedTextureS3TCsRGB::extensionName()
43 {
44 return "WEBGL_compressed_texture_s3tc_srgb";
45 }
46
47 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698