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

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

Issue 2547813002: Remove WebGLObject maps from WebGLRenderingContextBase and WebGLContextGroup. (Closed)
Patch Set: Fixed WebGLContextObject::validate. Made WebGLExtension non-finalized. Created 4 years 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/WebGLCompressedTextureETC1.h" 5 #include "modules/webgl/WebGLCompressedTextureETC1.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
11 WebGLCompressedTextureETC1::WebGLCompressedTextureETC1( 11 WebGLCompressedTextureETC1::WebGLCompressedTextureETC1(
12 WebGLRenderingContextBase* context) 12 WebGLRenderingContextBase* context)
13 : WebGLExtension(context) { 13 : WebGLExtension(context) {
14 context->addCompressedTextureFormat(GL_ETC1_RGB8_OES); 14 context->addCompressedTextureFormat(GL_ETC1_RGB8_OES);
15 } 15 }
16 16
17 WebGLCompressedTextureETC1::~WebGLCompressedTextureETC1() {}
18
19 WebGLExtensionName WebGLCompressedTextureETC1::name() const { 17 WebGLExtensionName WebGLCompressedTextureETC1::name() const {
20 return WebGLCompressedTextureETC1Name; 18 return WebGLCompressedTextureETC1Name;
21 } 19 }
22 20
23 WebGLCompressedTextureETC1* WebGLCompressedTextureETC1::create( 21 WebGLCompressedTextureETC1* WebGLCompressedTextureETC1::create(
24 WebGLRenderingContextBase* context) { 22 WebGLRenderingContextBase* context) {
25 return new WebGLCompressedTextureETC1(context); 23 return new WebGLCompressedTextureETC1(context);
26 } 24 }
27 25
28 bool WebGLCompressedTextureETC1::supported(WebGLRenderingContextBase* context) { 26 bool WebGLCompressedTextureETC1::supported(WebGLRenderingContextBase* context) {
29 Extensions3DUtil* extensionsUtil = context->extensionsUtil(); 27 Extensions3DUtil* extensionsUtil = context->extensionsUtil();
30 bool webgl1 = !context->isWebGL2OrHigher(); 28 bool webgl1 = !context->isWebGL2OrHigher();
31 bool etc1 = 29 bool etc1 =
32 extensionsUtil->supportsExtension("GL_OES_compressed_ETC1_RGB8_texture"); 30 extensionsUtil->supportsExtension("GL_OES_compressed_ETC1_RGB8_texture");
33 bool etc = 31 bool etc =
34 extensionsUtil->supportsExtension("GL_CHROMIUM_compressed_texture_etc"); 32 extensionsUtil->supportsExtension("GL_CHROMIUM_compressed_texture_etc");
35 return (webgl1 || etc) && etc1; 33 return (webgl1 || etc) && etc1;
36 } 34 }
37 35
38 const char* WebGLCompressedTextureETC1::extensionName() { 36 const char* WebGLCompressedTextureETC1::extensionName() {
39 return "WEBGL_compressed_texture_etc1"; 37 return "WEBGL_compressed_texture_etc1";
40 } 38 }
41 39
42 } // namespace blink 40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698