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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h

Issue 1983953002: Replace uses of v8::Persistent with ScopedPersistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef WebGLVertexArrayObjectBase_h 5 #ifndef WebGLVertexArrayObjectBase_h
6 #define WebGLVertexArrayObjectBase_h 6 #define WebGLVertexArrayObjectBase_h
7 7
8 #include "bindings/core/v8/ScopedPersistent.h"
8 #include "modules/webgl/WebGLBuffer.h" 9 #include "modules/webgl/WebGLBuffer.h"
9 #include "modules/webgl/WebGLContextObject.h" 10 #include "modules/webgl/WebGLContextObject.h"
10 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 class WebGLVertexArrayObjectBase : public WebGLContextObject { 15 class WebGLVertexArrayObjectBase : public WebGLContextObject {
15 public: 16 public:
16 enum VaoType { 17 enum VaoType {
17 VaoTypeDefault, 18 VaoTypeDefault,
18 VaoTypeUser, 19 VaoTypeUser,
19 }; 20 };
20 21
21 ~WebGLVertexArrayObjectBase() override; 22 ~WebGLVertexArrayObjectBase() override;
22 23
23 GLuint object() const { return m_object; } 24 GLuint object() const { return m_object; }
24 25
25 bool isDefaultObject() const { return m_type == VaoTypeDefault; } 26 bool isDefaultObject() const { return m_type == VaoTypeDefault; }
26 27
27 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } 28 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
28 void setHasEverBeenBound() { m_hasEverBeenBound = true; } 29 void setHasEverBeenBound() { m_hasEverBeenBound = true; }
29 30
30 WebGLBuffer* boundElementArrayBuffer() const { return m_boundElementArrayBuf fer; } 31 WebGLBuffer* boundElementArrayBuffer() const { return m_boundElementArrayBuf fer; }
31 void setElementArrayBuffer(WebGLBuffer*); 32 void setElementArrayBuffer(WebGLBuffer*);
32 33
33 WebGLBuffer* getArrayBufferForAttrib(size_t); 34 WebGLBuffer* getArrayBufferForAttrib(size_t);
34 void setArrayBufferForAttrib(GLuint, WebGLBuffer*); 35 void setArrayBufferForAttrib(GLuint, WebGLBuffer*);
35 void unbindBuffer(WebGLBuffer*); 36 void unbindBuffer(WebGLBuffer*);
36 37
37 V8CopyablePersistent<v8::Array>* getPersistentCache(); 38 ScopedPersistent<v8::Array>* getPersistentCache();
38 39
39 DECLARE_VIRTUAL_TRACE(); 40 DECLARE_VIRTUAL_TRACE();
40 41
41 protected: 42 protected:
42 WebGLVertexArrayObjectBase(WebGLRenderingContextBase*, VaoType); 43 WebGLVertexArrayObjectBase(WebGLRenderingContextBase*, VaoType);
43 44
44 private: 45 private:
45 void dispatchDetached(gpu::gles2::GLES2Interface*); 46 void dispatchDetached(gpu::gles2::GLES2Interface*);
46 bool hasObject() const override { return m_object != 0; } 47 bool hasObject() const override { return m_object != 0; }
47 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override; 48 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override;
48 49
49 GLuint m_object; 50 GLuint m_object;
50 51
51 VaoType m_type; 52 VaoType m_type;
52 bool m_hasEverBeenBound; 53 bool m_hasEverBeenBound;
53 bool m_destructionInProgress; 54 bool m_destructionInProgress;
54 Member<WebGLBuffer> m_boundElementArrayBuffer; 55 Member<WebGLBuffer> m_boundElementArrayBuffer;
55 HeapVector<Member<WebGLBuffer>> m_arrayBufferList; 56 HeapVector<Member<WebGLBuffer>> m_arrayBufferList;
56 57
57 // For preserving the wrappers of WebGLBuffer objects latched in 58 // For preserving the wrappers of WebGLBuffer objects latched in
58 // via vertexAttribPointer calls. 59 // via vertexAttribPointer calls.
59 V8CopyablePersistent<v8::Array> m_arrayBufferWrappers; 60 ScopedPersistent<v8::Array> m_arrayBufferWrappers;
60 }; 61 };
61 62
62 } // namespace blink 63 } // namespace blink
63 64
64 #endif // WebGLVertexArrayObjectBase_h 65 #endif // WebGLVertexArrayObjectBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698