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 |
178 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le
ngth); | 180 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le
ngth); |
179 | 181 |
180 ScriptValue getInt64Parameter(ScriptState*, GLenum); | 182 ScriptValue getInt64Parameter(ScriptState*, GLenum); |
181 | 183 |
182 void texSubImage3DImpl(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, I
mage*, WebGLImageConversion::ImageHtmlDomSource, bool, bool); | 184 void texSubImage3DImpl(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, I
mage*, WebGLImageConversion::ImageHtmlDomSource, bool, bool); |
183 | 185 |
184 /* WebGLRenderingContextBase overrides */ | 186 /* WebGLRenderingContextBase overrides */ |
185 bool validateCapability(const char* functionName, GLenum) override; | 187 bool validateCapability(const char* functionName, GLenum) override; |
186 bool validateBufferTarget(const char* functionName, GLenum target) override; | 188 bool validateBufferTarget(const char* functionName, GLenum target) override; |
187 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web
GLBuffer*) override; | 189 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web
GLBuffer*) override; |
188 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target
, bool useSixEnumsForCubeMap) override; | 190 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target
, bool useSixEnumsForCubeMap) override; |
189 bool validateFramebufferTarget(GLenum target) override; | 191 bool validateFramebufferTarget(GLenum target) override; |
190 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; | 192 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; |
| 193 GLenum boundFramebufferColorFormat() override; |
191 | 194 |
192 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; | 195 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; |
193 }; | 196 }; |
194 | 197 |
195 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, | 198 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, |
196 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, | 199 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, |
197 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; | 200 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; |
198 | 201 |
199 } // namespace blink | 202 } // namespace blink |
200 | 203 |
201 #endif | 204 #endif |
OLD | NEW |