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 "core/html/canvas/WebGLExtension.h" | 8 #include "core/html/canvas/WebGLExtension.h" |
9 #include "core/html/canvas/WebGLRenderingContextBase.h" | 9 #include "core/html/canvas/WebGLRenderingContextBase.h" |
10 #include "wtf/PassRefPtr.h" | 10 #include "wtf/PassRefPtr.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 /* Vertex Array Objects */ | 156 /* Vertex Array Objects */ |
157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> createVertexArray(); | 157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> createVertexArray(); |
158 void deleteVertexArray(WebGLVertexArrayObjectOES*); | 158 void deleteVertexArray(WebGLVertexArrayObjectOES*); |
159 GLboolean isVertexArray(WebGLVertexArrayObjectOES*); | 159 GLboolean isVertexArray(WebGLVertexArrayObjectOES*); |
160 void bindVertexArray(WebGLVertexArrayObjectOES*); | 160 void bindVertexArray(WebGLVertexArrayObjectOES*); |
161 | 161 |
162 /* WebGLRenderingContextBase overrides */ | 162 /* WebGLRenderingContextBase overrides */ |
163 void initializeNewContext() override; | 163 void initializeNewContext() override; |
164 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; | 164 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; |
| 165 void deleteFramebuffer(WebGLFramebuffer*) override; |
165 ScriptValue getParameter(ScriptState*, GLenum pname) override; | 166 ScriptValue getParameter(ScriptState*, GLenum pname) override; |
166 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr
ide; | 167 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr
ide; |
167 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G
Lenum attachment, GLenum pname) override; | 168 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G
Lenum attachment, GLenum pname) override; |
| 169 void restoreCurrentFramebuffer() override; |
168 | 170 |
169 DECLARE_VIRTUAL_TRACE(); | 171 DECLARE_VIRTUAL_TRACE(); |
170 | 172 |
171 protected: | 173 protected: |
172 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext
3D>, const WebGLContextAttributes& requestedAttributes); | 174 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext
3D>, const WebGLContextAttributes& requestedAttributes); |
173 | 175 |
174 // Helper function to validate target and the attachment combination for get
FramebufferAttachmentParameters. | 176 // Helper function to validate target and the attachment combination for get
FramebufferAttachmentParameters. |
175 // Generate GL error and return false if parameters are illegal. | 177 // Generate GL error and return false if parameters are illegal. |
176 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName,
GLenum target, GLenum attachment); | 178 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName,
GLenum target, GLenum attachment); |
177 | 179 |
(...skipping 11 matching lines...) Expand all Loading... |
189 void texSubImage3DImpl(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, I
mage*, WebGLImageConversion::ImageHtmlDomSource, bool, bool); | 191 void texSubImage3DImpl(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, I
mage*, WebGLImageConversion::ImageHtmlDomSource, bool, bool); |
190 | 192 |
191 /* WebGLRenderingContextBase overrides */ | 193 /* WebGLRenderingContextBase overrides */ |
192 bool validateCapability(const char* functionName, GLenum) override; | 194 bool validateCapability(const char* functionName, GLenum) override; |
193 bool validateBufferTarget(const char* functionName, GLenum target) override; | 195 bool validateBufferTarget(const char* functionName, GLenum target) override; |
194 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web
GLBuffer*) override; | 196 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web
GLBuffer*) override; |
195 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target
, bool useSixEnumsForCubeMap) override; | 197 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target
, bool useSixEnumsForCubeMap) override; |
196 bool validateFramebufferTarget(GLenum target) override; | 198 bool validateFramebufferTarget(GLenum target) override; |
197 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; | 199 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; |
198 GLint getMaxTextureLevelForTarget(GLenum target) override; | 200 GLint getMaxTextureLevelForTarget(GLenum target) override; |
| 201 GLenum boundFramebufferColorFormat() override; |
| 202 GLenum getDrawFramebufferTarget() override; |
199 | 203 |
200 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; | 204 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; |
201 GLint m_max3DTextureSize; | 205 GLint m_max3DTextureSize; |
202 GLint m_max3DTextureLevel; | 206 GLint m_max3DTextureLevel; |
203 }; | 207 }; |
204 | 208 |
205 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, | 209 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, |
206 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, | 210 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, |
207 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; | 211 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; |
208 | 212 |
209 } // namespace blink | 213 } // namespace blink |
210 | 214 |
211 #endif | 215 #endif |
OLD | NEW |