Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/OwnPtr.h"
9 #include "wtf/PassOwnPtr.h"
9 #include "wtf/text/CString.h" 10 #include "wtf/text/CString.h"
10 #include "wtf/text/StringHash.h" 11 #include "wtf/text/StringHash.h"
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 { 18 {
19 Vector<String> substrings; 19 Vector<String> substrings;
20 str.split(' ', substrings); 20 str.split(' ', substrings);
21 for (size_t i = 0; i < substrings.size(); ++i) 21 for (size_t i = 0; i < substrings.size(); ++i)
22 set.add(substrings[i]); 22 set.add(substrings[i]);
23 } 23 }
24 24
25 } // anonymous namespace 25 } // anonymous namespace
26 26
27 std::unique_ptr<Extensions3DUtil> Extensions3DUtil::create(gpu::gles2::GLES2Inte rface* gl) 27 PassOwnPtr<Extensions3DUtil> Extensions3DUtil::create(gpu::gles2::GLES2Interface * gl)
28 { 28 {
29 std::unique_ptr<Extensions3DUtil> out = wrapUnique(new Extensions3DUtil(gl)) ; 29 OwnPtr<Extensions3DUtil> out = adoptPtr(new Extensions3DUtil(gl));
30 out->initializeExtensions(); 30 out->initializeExtensions();
31 return out; 31 return out;
32 } 32 }
33 33
34 Extensions3DUtil::Extensions3DUtil(gpu::gles2::GLES2Interface* gl) 34 Extensions3DUtil::Extensions3DUtil(gpu::gles2::GLES2Interface* gl)
35 : m_gl(gl) 35 : m_gl(gl)
36 , m_isValid(true) 36 , m_isValid(true)
37 { 37 {
38 } 38 }
39 39
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when 87 // TODO(zmo): restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when
88 // GLES2Interface::CopyTextureCHROMIUM(...) are fully functional. 88 // GLES2Interface::CopyTextureCHROMIUM(...) are fully functional.
89 if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL _RGBA) 89 if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL _RGBA)
90 && destType == GL_UNSIGNED_BYTE 90 && destType == GL_UNSIGNED_BYTE
91 && !level) 91 && !level)
92 return true; 92 return true;
93 return false; 93 return false;
94 } 94 }
95 95
96 } // namespace blink 96 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698