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 "platform/graphics/gpu/Extensions3DUtil.h" | 5 #include "platform/graphics/gpu/Extensions3DUtil.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 #include "platform/wtf/PtrUtil.h" | 9 #include "platform/wtf/PtrUtil.h" |
10 #include "platform/wtf/text/CString.h" | 10 #include "platform/wtf/text/CString.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 requestable_extensions_.Clear(); | 67 requestable_extensions_.Clear(); |
68 InitializeExtensions(); | 68 InitializeExtensions(); |
69 } | 69 } |
70 return enabled_extensions_.Contains(name); | 70 return enabled_extensions_.Contains(name); |
71 } | 71 } |
72 | 72 |
73 bool Extensions3DUtil::IsExtensionEnabled(const String& name) { | 73 bool Extensions3DUtil::IsExtensionEnabled(const String& name) { |
74 return enabled_extensions_.Contains(name); | 74 return enabled_extensions_.Contains(name); |
75 } | 75 } |
76 | 76 |
77 bool Extensions3DUtil::CanUseCopyTextureCHROMIUM(GLenum dest_target, | 77 bool Extensions3DUtil::CanUseCopyTextureCHROMIUM(GLenum dest_target) { |
78 GLenum dest_format, | 78 switch (dest_target) { |
79 GLenum dest_type, | 79 case GL_TEXTURE_2D: |
80 GLint level) { | 80 case GL_TEXTURE_CUBE_MAP_POSITIVE_X: |
81 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be | 81 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: |
82 // lifted when GLES2Interface::CopyTextureCHROMIUM(...) are fully functional. | 82 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: |
83 if (dest_target == GL_TEXTURE_2D && | 83 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: |
84 (dest_format == GL_RGB || dest_format == GL_RGBA) && | 84 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: |
85 dest_type == GL_UNSIGNED_BYTE && !level) | 85 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: |
86 return true; | 86 return true; |
87 return false; | 87 default: |
| 88 return false; |
| 89 } |
88 } | 90 } |
89 | 91 |
90 } // namespace blink | 92 } // namespace blink |
OLD | NEW |