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 "wtf/PassRefPtr.h" | |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void drawBuffers(const Vector<GLenum>&); | 96 void drawBuffers(const Vector<GLenum>&); |
98 void clearBufferiv(GLenum, GLint, DOMInt32Array*); | 97 void clearBufferiv(GLenum, GLint, DOMInt32Array*); |
99 void clearBufferiv(GLenum, GLint, const Vector<GLint>&); | 98 void clearBufferiv(GLenum, GLint, const Vector<GLint>&); |
100 void clearBufferuiv(GLenum, GLint, DOMUint32Array*); | 99 void clearBufferuiv(GLenum, GLint, DOMUint32Array*); |
101 void clearBufferuiv(GLenum, GLint, const Vector<GLuint>&); | 100 void clearBufferuiv(GLenum, GLint, const Vector<GLuint>&); |
102 void clearBufferfv(GLenum, GLint, DOMFloat32Array*); | 101 void clearBufferfv(GLenum, GLint, DOMFloat32Array*); |
103 void clearBufferfv(GLenum, GLint, const Vector<GLfloat>&); | 102 void clearBufferfv(GLenum, GLint, const Vector<GLfloat>&); |
104 void clearBufferfi(GLenum, GLint, GLfloat, GLint); | 103 void clearBufferfi(GLenum, GLint, GLfloat, GLint); |
105 | 104 |
106 /* Query Objects */ | 105 /* Query Objects */ |
107 PassRefPtrWillBeRawPtr<WebGLQuery> createQuery(); | 106 WebGLQuery* createQuery(); |
108 void deleteQuery(WebGLQuery*); | 107 void deleteQuery(WebGLQuery*); |
109 GLboolean isQuery(WebGLQuery*); | 108 GLboolean isQuery(WebGLQuery*); |
110 void beginQuery(GLenum, WebGLQuery*); | 109 void beginQuery(GLenum, WebGLQuery*); |
111 void endQuery(GLenum); | 110 void endQuery(GLenum); |
112 PassRefPtrWillBeRawPtr<WebGLQuery> getQuery(GLenum, GLenum); | 111 WebGLQuery* getQuery(GLenum, GLenum); |
113 ScriptValue getQueryParameter(ScriptState*, WebGLQuery*, GLenum); | 112 ScriptValue getQueryParameter(ScriptState*, WebGLQuery*, GLenum); |
114 | 113 |
115 /* Sampler Objects */ | 114 /* Sampler Objects */ |
116 PassRefPtrWillBeRawPtr<WebGLSampler> createSampler(); | 115 WebGLSampler* createSampler(); |
117 void deleteSampler(WebGLSampler*); | 116 void deleteSampler(WebGLSampler*); |
118 GLboolean isSampler(WebGLSampler*); | 117 GLboolean isSampler(WebGLSampler*); |
119 void bindSampler(GLuint, WebGLSampler*); | 118 void bindSampler(GLuint, WebGLSampler*); |
120 void samplerParameteri(WebGLSampler*, GLenum, GLint); | 119 void samplerParameteri(WebGLSampler*, GLenum, GLint); |
121 void samplerParameterf(WebGLSampler*, GLenum, GLfloat); | 120 void samplerParameterf(WebGLSampler*, GLenum, GLfloat); |
122 ScriptValue getSamplerParameter(ScriptState*, WebGLSampler*, GLenum); | 121 ScriptValue getSamplerParameter(ScriptState*, WebGLSampler*, GLenum); |
123 | 122 |
124 /* Sync objects */ | 123 /* Sync objects */ |
125 PassRefPtrWillBeRawPtr<WebGLSync> fenceSync(GLenum, GLbitfield); | 124 WebGLSync* fenceSync(GLenum, GLbitfield); |
126 GLboolean isSync(WebGLSync*); | 125 GLboolean isSync(WebGLSync*); |
127 void deleteSync(WebGLSync*); | 126 void deleteSync(WebGLSync*); |
128 GLenum clientWaitSync(WebGLSync*, GLbitfield, GLint64); | 127 GLenum clientWaitSync(WebGLSync*, GLbitfield, GLint64); |
129 void waitSync(WebGLSync*, GLbitfield, GLint64); | 128 void waitSync(WebGLSync*, GLbitfield, GLint64); |
130 | 129 |
131 ScriptValue getSyncParameter(ScriptState*, WebGLSync*, GLenum); | 130 ScriptValue getSyncParameter(ScriptState*, WebGLSync*, GLenum); |
132 | 131 |
133 /* Transform Feedback */ | 132 /* Transform Feedback */ |
134 PassRefPtrWillBeRawPtr<WebGLTransformFeedback> createTransformFeedback(); | 133 WebGLTransformFeedback* createTransformFeedback(); |
135 void deleteTransformFeedback(WebGLTransformFeedback*); | 134 void deleteTransformFeedback(WebGLTransformFeedback*); |
136 GLboolean isTransformFeedback(WebGLTransformFeedback*); | 135 GLboolean isTransformFeedback(WebGLTransformFeedback*); |
137 void bindTransformFeedback(GLenum, WebGLTransformFeedback*); | 136 void bindTransformFeedback(GLenum, WebGLTransformFeedback*); |
138 void beginTransformFeedback(GLenum); | 137 void beginTransformFeedback(GLenum); |
139 void endTransformFeedback(); | 138 void endTransformFeedback(); |
140 void transformFeedbackVaryings(WebGLProgram*, const Vector<String>&, GLenum)
; | 139 void transformFeedbackVaryings(WebGLProgram*, const Vector<String>&, GLenum)
; |
141 PassRefPtrWillBeRawPtr<WebGLActiveInfo> getTransformFeedbackVarying(WebGLPro
gram*, GLuint); | 140 WebGLActiveInfo* getTransformFeedbackVarying(WebGLProgram*, GLuint); |
142 void pauseTransformFeedback(); | 141 void pauseTransformFeedback(); |
143 void resumeTransformFeedback(); | 142 void resumeTransformFeedback(); |
144 | 143 |
145 /* Uniform Buffer Objects and Transform Feedback Buffers */ | 144 /* Uniform Buffer Objects and Transform Feedback Buffers */ |
146 void bindBufferBase(GLenum, GLuint, WebGLBuffer*); | 145 void bindBufferBase(GLenum, GLuint, WebGLBuffer*); |
147 void bindBufferRange(GLenum, GLuint, WebGLBuffer*, long long, long long); | 146 void bindBufferRange(GLenum, GLuint, WebGLBuffer*, long long, long long); |
148 ScriptValue getIndexedParameter(ScriptState*, GLenum, GLuint); | 147 ScriptValue getIndexedParameter(ScriptState*, GLenum, GLuint); |
149 Vector<GLuint> getUniformIndices(WebGLProgram*, const Vector<String>&); | 148 Vector<GLuint> getUniformIndices(WebGLProgram*, const Vector<String>&); |
150 Vector<GLint> getActiveUniforms(WebGLProgram*, const Vector<GLuint>&, GLenum
); | 149 Vector<GLint> getActiveUniforms(WebGLProgram*, const Vector<GLuint>&, GLenum
); |
151 GLuint getUniformBlockIndex(WebGLProgram*, const String&); | 150 GLuint getUniformBlockIndex(WebGLProgram*, const String&); |
152 ScriptValue getActiveUniformBlockParameter(ScriptState*, WebGLProgram*, GLui
nt, GLenum); | 151 ScriptValue getActiveUniformBlockParameter(ScriptState*, WebGLProgram*, GLui
nt, GLenum); |
153 String getActiveUniformBlockName(WebGLProgram*, GLuint); | 152 String getActiveUniformBlockName(WebGLProgram*, GLuint); |
154 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint); | 153 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint); |
155 | 154 |
156 /* Vertex Array Objects */ | 155 /* Vertex Array Objects */ |
157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObject> createVertexArray(); | 156 WebGLVertexArrayObject* createVertexArray(); |
158 void deleteVertexArray(WebGLVertexArrayObject*); | 157 void deleteVertexArray(WebGLVertexArrayObject*); |
159 GLboolean isVertexArray(WebGLVertexArrayObject*); | 158 GLboolean isVertexArray(WebGLVertexArrayObject*); |
160 void bindVertexArray(WebGLVertexArrayObject*); | 159 void bindVertexArray(WebGLVertexArrayObject*); |
161 | 160 |
162 /* WebGLRenderingContextBase overrides */ | 161 /* WebGLRenderingContextBase overrides */ |
163 void initializeNewContext() override; | 162 void initializeNewContext() override; |
164 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; | 163 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; |
165 void deleteFramebuffer(WebGLFramebuffer*) override; | 164 void deleteFramebuffer(WebGLFramebuffer*) override; |
166 ScriptValue getParameter(ScriptState*, GLenum pname) override; | 165 ScriptValue getParameter(ScriptState*, GLenum pname) override; |
167 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr
ide; | 166 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr
ide; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 bool validateReadPixelsFormatAndType(GLenum format, GLenum type) override; | 200 bool validateReadPixelsFormatAndType(GLenum format, GLenum type) override; |
202 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; | 201 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; |
203 GLint getMaxTextureLevelForTarget(GLenum target) override; | 202 GLint getMaxTextureLevelForTarget(GLenum target) override; |
204 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal
format, GLsizei width, GLsizei height, const char* functionName) override; | 203 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal
format, GLsizei width, GLsizei height, const char* functionName) override; |
205 GLenum boundFramebufferColorFormat() override; | 204 GLenum boundFramebufferColorFormat() override; |
206 | 205 |
207 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe
t) override; | 206 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe
t) override; |
208 | 207 |
209 void removeBoundBuffer(WebGLBuffer*) override; | 208 void removeBoundBuffer(WebGLBuffer*) override; |
210 | 209 |
211 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; | 210 PersistentWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; |
212 RefPtrWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding; | 211 PersistentWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding; |
213 GLint m_max3DTextureSize; | 212 GLint m_max3DTextureSize; |
214 GLint m_max3DTextureLevel; | 213 GLint m_max3DTextureLevel; |
215 | 214 |
216 RefPtrWillBeMember<WebGLBuffer> m_boundCopyReadBuffer; | 215 PersistentWillBeMember<WebGLBuffer> m_boundCopyReadBuffer; |
217 RefPtrWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer; | 216 PersistentWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer; |
218 RefPtrWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; | 217 PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; |
219 RefPtrWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer; | 218 PersistentWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer; |
220 RefPtrWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer; | 219 PersistentWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer; |
221 RefPtrWillBeMember<WebGLBuffer> m_boundUniformBuffer; | 220 PersistentWillBeMember<WebGLBuffer> m_boundUniformBuffer; |
222 | 221 |
223 RefPtrWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery; | 222 PersistentWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery; |
224 RefPtrWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWrittenQu
ery; | 223 PersistentWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWritt
enQuery; |
225 WillBeHeapVector<RefPtrWillBeMember<WebGLSampler>> m_samplerUnits; | 224 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits; |
226 }; | 225 }; |
227 | 226 |
228 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, | 227 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, |
229 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, | 228 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, |
230 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; | 229 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2)
; |
231 | 230 |
232 } // namespace blink | 231 } // namespace blink |
233 | 232 |
234 #endif | 233 #endif |
OLD | NEW |