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 // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lif ted when | 86 switch (destTarget) { |
87 case GL_TEXTURE_2D: | |
88 break; | |
89 // TODO(dshwang): support cube map. crbug.com/517548 | |
dshwang
2015/10/21 16:12:16
As https://codereview.chromium.org/1275773003 was
| |
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 | |
87 // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. | 102 // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. |
88 if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL _RGBA) | 103 if ((destFormat == GL_RGB || destFormat == GL_RGBA) |
89 && destType == GL_UNSIGNED_BYTE | 104 && destType == GL_UNSIGNED_BYTE |
90 && !level) | 105 && !level) |
91 return true; | 106 return true; |
92 return false; | 107 return false; |
93 } | 108 } |
94 | 109 |
95 } // namespace blink | 110 } // namespace blink |
OLD | NEW |