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

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

Issue 1387743002: Fixed expando-loss.html test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache ScriptState and use it to wrap m_defaultVertexArrayObject. Created 5 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
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 WebGL2RenderingContextBase_h 5 #ifndef WebGL2RenderingContextBase_h
6 #define WebGL2RenderingContextBase_h 6 #define WebGL2RenderingContextBase_h
7 7
8 #include "modules/webgl/WebGLExtension.h" 8 #include "modules/webgl/WebGLExtension.h"
9 #include "modules/webgl/WebGLRenderingContextBase.h" 9 #include "modules/webgl/WebGLRenderingContextBase.h"
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 ScriptValue getIndexedParameter(ScriptState*, GLenum, GLuint); 153 ScriptValue getIndexedParameter(ScriptState*, GLenum, GLuint);
154 Vector<GLuint> getUniformIndices(WebGLProgram*, const Vector<String>&); 154 Vector<GLuint> getUniformIndices(WebGLProgram*, const Vector<String>&);
155 Vector<GLint> getActiveUniforms(WebGLProgram*, const Vector<GLuint>&, GLenum ); 155 Vector<GLint> getActiveUniforms(WebGLProgram*, const Vector<GLuint>&, GLenum );
156 GLuint getUniformBlockIndex(WebGLProgram*, const String&); 156 GLuint getUniformBlockIndex(WebGLProgram*, const String&);
157 ScriptValue getActiveUniformBlockParameter(ScriptState*, WebGLProgram*, GLui nt, GLenum); 157 ScriptValue getActiveUniformBlockParameter(ScriptState*, WebGLProgram*, GLui nt, GLenum);
158 String getActiveUniformBlockName(WebGLProgram*, GLuint); 158 String getActiveUniformBlockName(WebGLProgram*, GLuint);
159 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint); 159 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint);
160 160
161 /* Vertex Array Objects */ 161 /* Vertex Array Objects */
162 WebGLVertexArrayObject* createVertexArray(); 162 WebGLVertexArrayObject* createVertexArray();
163 void deleteVertexArray(WebGLVertexArrayObject*); 163 void deleteVertexArray(ScriptState*, WebGLVertexArrayObject*);
164 GLboolean isVertexArray(WebGLVertexArrayObject*); 164 GLboolean isVertexArray(WebGLVertexArrayObject*);
165 void bindVertexArray(WebGLVertexArrayObject*); 165 void bindVertexArray(ScriptState*, WebGLVertexArrayObject*);
166 166
167 /* Reading */ 167 /* Reading */
168 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, long long offset); 168 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, long long offset);
169 169
170 /* WebGLRenderingContextBase overrides */ 170 /* WebGLRenderingContextBase overrides */
171 void initializeNewContext() override; 171 void initializeNewContext() override;
172 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; 172 void bindFramebuffer(ScriptState*, GLenum target, WebGLFramebuffer*) overrid e;
173 void deleteFramebuffer(WebGLFramebuffer*) override; 173 void deleteFramebuffer(WebGLFramebuffer*) override;
174 ScriptValue getParameter(ScriptState*, GLenum pname) override; 174 ScriptValue getParameter(ScriptState*, GLenum pname) override;
175 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide; 175 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide;
176 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override; 176 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override;
177 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, DOMArrayBufferView* pixels) override; 177 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, DOMArrayBufferView* pixels) override;
178 void restoreCurrentFramebuffer() override; 178 void restoreCurrentFramebuffer() override;
179 179
180 EAGERLY_FINALIZE(); 180 EAGERLY_FINALIZE();
181 DECLARE_VIRTUAL_TRACE(); 181 DECLARE_VIRTUAL_TRACE();
182 182
183 protected: 183 protected:
184 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes); 184 WebGL2RenderingContextBase(HTMLCanvasElement*, ScriptState*, PassOwnPtr<WebG raphicsContext3D>, const WebGLContextAttributes& requestedAttributes);
185 185
186 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters. 186 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters.
187 // Generate GL error and return false if parameters are illegal. 187 // Generate GL error and return false if parameters are illegal.
188 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName, GLenum target, GLenum attachment); 188 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName, GLenum target, GLenum attachment);
189 189
190 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le ngth); 190 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le ngth);
191 191
192 enum TexStorageType { 192 enum TexStorageType {
193 TexStorageType2D, 193 TexStorageType2D,
194 TexStorageType3D, 194 TexStorageType3D,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits; 254 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits;
255 }; 255 };
256 256
257 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 257 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
258 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 258 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
259 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 259 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
260 260
261 } // namespace blink 261 } // namespace blink
262 262
263 #endif 263 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698