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

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

Issue 1474513003: Upgrade PixelStorei to ES3/WebGL2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 /* Reading */ 168 /* Reading */
169 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, long long offset); 169 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, long long offset);
170 170
171 /* WebGLRenderingContextBase overrides */ 171 /* WebGLRenderingContextBase overrides */
172 void initializeNewContext() override; 172 void initializeNewContext() override;
173 void bindFramebuffer(ScriptState*, GLenum target, WebGLFramebuffer*) overrid e; 173 void bindFramebuffer(ScriptState*, GLenum target, WebGLFramebuffer*) overrid e;
174 void deleteFramebuffer(WebGLFramebuffer*) override; 174 void deleteFramebuffer(WebGLFramebuffer*) override;
175 ScriptValue getParameter(ScriptState*, GLenum pname) override; 175 ScriptValue getParameter(ScriptState*, GLenum pname) override;
176 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide; 176 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide;
177 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override; 177 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override;
178 void pixelStorei(GLenum pname, GLint param) override;
178 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, DOMArrayBufferView* pixels) override; 179 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, DOMArrayBufferView* pixels) override;
179 void restoreCurrentFramebuffer() override; 180 void restoreCurrentFramebuffer() override;
180 181
181 EAGERLY_FINALIZE(); 182 EAGERLY_FINALIZE();
182 DECLARE_VIRTUAL_TRACE(); 183 DECLARE_VIRTUAL_TRACE();
183 184
184 protected: 185 protected:
185 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes); 186 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes);
186 187
187 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters. 188 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; 226 WebGLFramebuffer* getFramebufferBinding(GLenum target) override;
226 GLint getMaxTextureLevelForTarget(GLenum target) override; 227 GLint getMaxTextureLevelForTarget(GLenum target) override;
227 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal format, GLsizei width, GLsizei height, const char* functionName) override; 228 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal format, GLsizei width, GLsizei height, const char* functionName) override;
228 GLenum boundFramebufferColorFormat() override; 229 GLenum boundFramebufferColorFormat() override;
229 230
230 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe t) override; 231 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe t) override;
231 bool validateBufferDataUsage(const char* functionName, GLenum usage) overrid e; 232 bool validateBufferDataUsage(const char* functionName, GLenum usage) overrid e;
232 233
233 void removeBoundBuffer(WebGLBuffer*) override; 234 void removeBoundBuffer(WebGLBuffer*) override;
234 235
236 // Set UNPACK_ALIGNMENT to 1, all other parameters to 0.
237 void resetUnpackParameters();
238 // Restore the client unset parameters.
239 void restoreUnpackParameters();
240
235 PersistentWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; 241 PersistentWillBeMember<WebGLFramebuffer> m_readFramebufferBinding;
236 PersistentWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding; 242 PersistentWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding;
237 GLint m_maxArrayTextureLayers; 243 GLint m_maxArrayTextureLayers;
238 244
239 std::set<GLenum> m_supportedInternalFormatsStorage; 245 std::set<GLenum> m_supportedInternalFormatsStorage;
240 246
241 PersistentWillBeMember<WebGLBuffer> m_boundCopyReadBuffer; 247 PersistentWillBeMember<WebGLBuffer> m_boundCopyReadBuffer;
242 PersistentWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer; 248 PersistentWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer;
243 PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; 249 PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer;
244 PersistentWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer; 250 PersistentWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer;
245 PersistentWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer; 251 PersistentWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer;
246 PersistentWillBeMember<WebGLBuffer> m_boundUniformBuffer; 252 PersistentWillBeMember<WebGLBuffer> m_boundUniformBuffer;
247 253
248 PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedTran sformFeedbackBuffers; 254 PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedTran sformFeedbackBuffers;
249 PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedUnif ormBuffers; 255 PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedUnif ormBuffers;
250 size_t m_maxBoundUniformBufferIndex; 256 size_t m_maxBoundUniformBufferIndex;
251 257
252 PersistentWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery; 258 PersistentWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery;
253 PersistentWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWritt enQuery; 259 PersistentWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWritt enQuery;
254 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits; 260 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits;
261
262 GLint m_packRowLength;
263 GLint m_packSkipPixels;
264 GLint m_packSkipRows;
265 GLint m_unpackRowLength;
266 GLint m_unpackImageHeight;
267 GLint m_unpackSkipPixels;
268 GLint m_unpackSkipRows;
269 GLint m_unpackSkipImages;
255 }; 270 };
256 271
257 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 272 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
258 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 273 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
259 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 274 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
260 275
261 } // namespace blink 276 } // namespace blink
262 277
263 #endif 278 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698