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 "gpu/command_buffer/client/gles2_interface.h" | 7 #include "gpu/command_buffer/client/gles2_interface.h" |
| 8 #include "third_party/khronos/GLES2/gl2ext.h" |
| 9 #include "third_party/khronos/GLES3/gl3.h" |
8 #include "wtf/PtrUtil.h" | 10 #include "wtf/PtrUtil.h" |
9 #include "wtf/text/CString.h" | 11 #include "wtf/text/CString.h" |
10 #include "wtf/text/StringHash.h" | 12 #include "wtf/text/StringHash.h" |
11 #include <memory> | 13 #include <memory> |
12 | 14 |
13 namespace blink { | 15 namespace blink { |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 void splitStringHelper(const String& str, HashSet<String>& set) { | 19 void splitStringHelper(const String& str, HashSet<String>& set) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 return m_enabledExtensions.contains(name); | 75 return m_enabledExtensions.contains(name); |
74 } | 76 } |
75 | 77 |
76 bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, | 78 bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, |
77 GLenum destFormat, | 79 GLenum destFormat, |
78 GLenum destType, | 80 GLenum destType, |
79 GLint level) { | 81 GLint level) { |
80 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be | 82 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be |
81 // lifted when GLES2Interface::CopyTextureCHROMIUM(...) are fully functional. | 83 // lifted when GLES2Interface::CopyTextureCHROMIUM(...) are fully functional. |
82 if (destTarget == GL_TEXTURE_2D && | 84 if (destTarget == GL_TEXTURE_2D && |
83 (destFormat == GL_RGB || destFormat == GL_RGBA) && | 85 ((destType == GL_UNSIGNED_BYTE && |
84 destType == GL_UNSIGNED_BYTE && !level) | 86 (destFormat == GL_RGB || destFormat == GL_RGBA)) || |
| 87 (destType == GL_FLOAT && |
| 88 ((destFormat == GL_RGBA && |
| 89 supportsExtension("GL_CHROMIUM_color_buffer_float_rgba")) || |
| 90 (destFormat == GL_RGB && |
| 91 supportsExtension("GL_CHROMIUM_color_buffer_float_rgb"))))) && |
| 92 !level) |
85 return true; | 93 return true; |
86 return false; | 94 return false; |
87 } | 95 } |
88 | 96 |
89 } // namespace blink | 97 } // namespace blink |
OLD | NEW |