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

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

Issue 2401893002: [wrapper-tracing] WebGL and friends: Add write barriers (Closed)
Patch Set: Rebase Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 5 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
6 6
7 #include "gpu/command_buffer/client/gles2_interface.h" 7 #include "gpu/command_buffer/client/gles2_interface.h"
8 #include "modules/webgl/WebGLRenderingContextBase.h" 8 #include "modules/webgl/WebGLRenderingContextBase.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase( 12 WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(
13 WebGLRenderingContextBase* ctx, 13 WebGLRenderingContextBase* ctx,
14 VaoType type) 14 VaoType type)
15 : WebGLContextObject(ctx), 15 : WebGLContextObject(ctx),
16 m_object(0), 16 m_object(0),
17 m_type(type), 17 m_type(type),
18 m_hasEverBeenBound(false), 18 m_hasEverBeenBound(false),
19 m_destructionInProgress(false), 19 m_destructionInProgress(false),
20 m_boundElementArrayBuffer(nullptr), 20 m_boundElementArrayBuffer(this, nullptr),
21 m_isAllEnabledAttribBufferBound(true) { 21 m_isAllEnabledAttribBufferBound(true) {
22 m_arrayBufferList.resize(ctx->maxVertexAttribs()); 22 m_arrayBufferList.resize(ctx->maxVertexAttribs());
23 m_attribEnabled.resize(ctx->maxVertexAttribs()); 23 m_attribEnabled.resize(ctx->maxVertexAttribs());
24 for (size_t i = 0; i < m_attribEnabled.size(); ++i) { 24 for (size_t i = 0; i < m_attribEnabled.size(); ++i) {
25 m_attribEnabled[i] = false; 25 m_attribEnabled[i] = false;
26 } 26 }
27 27
28 switch (m_type) { 28 switch (m_type) {
29 case VaoTypeDefault: 29 case VaoTypeDefault:
30 break; 30 break;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return m_arrayBufferList[index].get(); 87 return m_arrayBufferList[index].get();
88 } 88 }
89 89
90 void WebGLVertexArrayObjectBase::setArrayBufferForAttrib(GLuint index, 90 void WebGLVertexArrayObjectBase::setArrayBufferForAttrib(GLuint index,
91 WebGLBuffer* buffer) { 91 WebGLBuffer* buffer) {
92 if (buffer) 92 if (buffer)
93 buffer->onAttached(); 93 buffer->onAttached();
94 if (m_arrayBufferList[index]) 94 if (m_arrayBufferList[index])
95 m_arrayBufferList[index]->onDetached(context()->contextGL()); 95 m_arrayBufferList[index]->onDetached(context()->contextGL());
96 96
97 m_arrayBufferList[index] = buffer; 97 m_arrayBufferList[index] = TraceWrapperMember<WebGLBuffer>(this, buffer);
98 updateAttribBufferBoundStatus(); 98 updateAttribBufferBoundStatus();
99 } 99 }
100 100
101 void WebGLVertexArrayObjectBase::setAttribEnabled(GLuint index, bool enabled) { 101 void WebGLVertexArrayObjectBase::setAttribEnabled(GLuint index, bool enabled) {
102 DCHECK(index < context()->maxVertexAttribs()); 102 DCHECK(index < context()->maxVertexAttribs());
103 m_attribEnabled[index] = enabled; 103 m_attribEnabled[index] = enabled;
104 updateAttribBufferBoundStatus(); 104 updateAttribBufferBoundStatus();
105 } 105 }
106 106
107 bool WebGLVertexArrayObjectBase::getAttribEnabled(GLuint index) const { 107 bool WebGLVertexArrayObjectBase::getAttribEnabled(GLuint index) const {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 DEFINE_TRACE_WRAPPERS(WebGLVertexArrayObjectBase) { 154 DEFINE_TRACE_WRAPPERS(WebGLVertexArrayObjectBase) {
155 visitor->traceWrappers(m_boundElementArrayBuffer); 155 visitor->traceWrappers(m_boundElementArrayBuffer);
156 for (size_t i = 0; i < m_arrayBufferList.size(); ++i) { 156 for (size_t i = 0; i < m_arrayBufferList.size(); ++i) {
157 visitor->traceWrappers(m_arrayBufferList[i]); 157 visitor->traceWrappers(m_arrayBufferList[i]);
158 } 158 }
159 WebGLContextObject::traceWrappers(visitor); 159 WebGLContextObject::traceWrappers(visitor);
160 } 160 }
161 161
162 } // namespace blink 162 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698