OLD | NEW |
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 #include <memory> | |
11 | 10 |
12 namespace blink { | 11 namespace blink { |
13 | 12 |
14 class WebGLTexture; | 13 class WebGLTexture; |
15 | 14 |
16 class WebGLActiveInfo; | 15 class WebGLActiveInfo; |
17 class WebGLBuffer; | 16 class WebGLBuffer; |
18 class WebGLProgram; | 17 class WebGLProgram; |
19 class WebGLQuery; | 18 class WebGLQuery; |
20 class WebGLSampler; | 19 class WebGLSampler; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr
ide; | 210 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr
ide; |
212 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G
Lenum attachment, GLenum pname) override; | 211 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G
Lenum attachment, GLenum pname) override; |
213 void pixelStorei(GLenum pname, GLint param) override; | 212 void pixelStorei(GLenum pname, GLint param) override; |
214 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form
at, GLenum type, DOMArrayBufferView* pixels) override; | 213 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form
at, GLenum type, DOMArrayBufferView* pixels) override; |
215 void restoreCurrentFramebuffer() override; | 214 void restoreCurrentFramebuffer() override; |
216 | 215 |
217 EAGERLY_FINALIZE(); | 216 EAGERLY_FINALIZE(); |
218 DECLARE_VIRTUAL_TRACE(); | 217 DECLARE_VIRTUAL_TRACE(); |
219 | 218 |
220 protected: | 219 protected: |
221 WebGL2RenderingContextBase(HTMLCanvasElement*, std::unique_ptr<WebGraphicsCo
ntext3DProvider>, const WebGLContextAttributes& requestedAttributes); | 220 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext
3DProvider>, const WebGLContextAttributes& requestedAttributes); |
222 | 221 |
223 // Helper function to validate target and the attachment combination for get
FramebufferAttachmentParameters. | 222 // Helper function to validate target and the attachment combination for get
FramebufferAttachmentParameters. |
224 // Generate GL error and return false if parameters are illegal. | 223 // Generate GL error and return false if parameters are illegal. |
225 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName,
GLenum target, GLenum attachment); | 224 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName,
GLenum target, GLenum attachment); |
226 | 225 |
227 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le
ngth); | 226 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le
ngth); |
228 | 227 |
229 enum TexStorageType { | 228 enum TexStorageType { |
230 TexStorageType2D, | 229 TexStorageType2D, |
231 TexStorageType3D, | 230 TexStorageType3D, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 ScopedPersistent<v8::Array> m_queryWrappers; | 313 ScopedPersistent<v8::Array> m_queryWrappers; |
315 }; | 314 }; |
316 | 315 |
317 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, | 316 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, |
318 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, | 317 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, |
319 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; | 318 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; |
320 | 319 |
321 } // namespace blink | 320 } // namespace blink |
322 | 321 |
323 #endif | 322 #endif |
OLD | NEW |