OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "platform/graphics/gpu/Extensions3DUtil.h" | 6 #include "platform/graphics/gpu/Extensions3DUtil.h" |
7 | 7 |
8 #include "public/platform/WebGraphicsContext3D.h" | 8 #include "public/platform/WebGraphicsContext3D.h" |
9 #include "wtf/text/CString.h" | 9 #include "wtf/text/CString.h" |
10 #include "wtf/text/StringHash.h" | 10 #include "wtf/text/StringHash.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 return m_enabledExtensions.contains(name); | 76 return m_enabledExtensions.contains(name); |
77 } | 77 } |
78 | 78 |
79 bool Extensions3DUtil::isExtensionEnabled(const String& name) | 79 bool Extensions3DUtil::isExtensionEnabled(const String& name) |
80 { | 80 { |
81 return m_enabledExtensions.contains(name); | 81 return m_enabledExtensions.contains(name); |
82 } | 82 } |
83 | 83 |
84 bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destF
ormat, GLenum destType, GLint level) | 84 bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destF
ormat, GLenum destType, GLint level) |
85 { | 85 { |
86 switch (destTarget) { | 86 // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lif
ted when |
87 case GL_TEXTURE_2D: | |
88 break; | |
89 // TODO(dshwang): support cube map. crbug.com/517548 | |
90 case GL_TEXTURE_CUBE_MAP_POSITIVE_X: | |
91 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: | |
92 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: | |
93 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: | |
94 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: | |
95 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: | |
96 return false; | |
97 default: | |
98 ASSERT_NOT_REACHED(); | |
99 return false; | |
100 } | |
101 // TODO(dshwang): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) shoul
d be lifted when | |
102 // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. | 87 // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. |
103 if ((destFormat == GL_RGB || destFormat == GL_RGBA) | 88 if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL
_RGBA) |
104 && destType == GL_UNSIGNED_BYTE | 89 && destType == GL_UNSIGNED_BYTE |
105 && !level) | 90 && !level) |
106 return true; | 91 return true; |
107 return false; | 92 return false; |
108 } | 93 } |
109 | 94 |
110 } // namespace blink | 95 } // namespace blink |
OLD | NEW |