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