| 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 "wtf/PtrUtil.h" | 8 #include "wtf/PtrUtil.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" |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 void splitStringHelper(const String& str, HashSet<String>& set) { | 17 void splitStringHelper(const String& str, HashSet<String>& set) { |
| 18 Vector<String> substrings; | 18 Vector<String> substrings; |
| 19 str.split(' ', substrings); | 19 str.split(' ', substrings); |
| 20 for (size_t i = 0; i < substrings.size(); ++i) | 20 for (size_t i = 0; i < substrings.size(); ++i) |
| 21 set.add(substrings[i]); | 21 set.add(substrings[i]); |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // anonymous namespace | 24 } // anonymous namespace |
| 25 | 25 |
| 26 std::unique_ptr<Extensions3DUtil> Extensions3DUtil::create( | 26 std::unique_ptr<Extensions3DUtil> Extensions3DUtil::create( |
| 27 gpu::gles2::GLES2Interface* gl) { | 27 gpu::gles2::GLES2Interface* gl) { |
| 28 std::unique_ptr<Extensions3DUtil> out = wrapUnique(new Extensions3DUtil(gl)); | 28 std::unique_ptr<Extensions3DUtil> out = |
| 29 WTF::wrapUnique(new Extensions3DUtil(gl)); |
| 29 out->initializeExtensions(); | 30 out->initializeExtensions(); |
| 30 return out; | 31 return out; |
| 31 } | 32 } |
| 32 | 33 |
| 33 Extensions3DUtil::Extensions3DUtil(gpu::gles2::GLES2Interface* gl) | 34 Extensions3DUtil::Extensions3DUtil(gpu::gles2::GLES2Interface* gl) |
| 34 : m_gl(gl), m_isValid(true) {} | 35 : m_gl(gl), m_isValid(true) {} |
| 35 | 36 |
| 36 Extensions3DUtil::~Extensions3DUtil() {} | 37 Extensions3DUtil::~Extensions3DUtil() {} |
| 37 | 38 |
| 38 void Extensions3DUtil::initializeExtensions() { | 39 void Extensions3DUtil::initializeExtensions() { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be | 81 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be |
| 81 // lifted when GLES2Interface::CopyTextureCHROMIUM(...) are fully functional. | 82 // lifted when GLES2Interface::CopyTextureCHROMIUM(...) are fully functional. |
| 82 if (destTarget == GL_TEXTURE_2D && | 83 if (destTarget == GL_TEXTURE_2D && |
| 83 (destFormat == GL_RGB || destFormat == GL_RGBA) && | 84 (destFormat == GL_RGB || destFormat == GL_RGBA) && |
| 84 destType == GL_UNSIGNED_BYTE && !level) | 85 destType == GL_UNSIGNED_BYTE && !level) |
| 85 return true; | 86 return true; |
| 86 return false; | 87 return false; |
| 87 } | 88 } |
| 88 | 89 |
| 89 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |