OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WebGLRenderingContextBase_h | 26 #ifndef WebGLRenderingContextBase_h |
27 #define WebGLRenderingContextBase_h | 27 #define WebGLRenderingContextBase_h |
28 | 28 |
29 #include <memory> | |
30 #include <set> | |
31 #include "bindings/core/v8/Nullable.h" | 29 #include "bindings/core/v8/Nullable.h" |
32 #include "bindings/core/v8/ScriptState.h" | 30 #include "bindings/core/v8/ScriptState.h" |
33 #include "bindings/core/v8/ScriptValue.h" | 31 #include "bindings/core/v8/ScriptValue.h" |
34 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
35 #include "bindings/core/v8/ScriptWrappableVisitor.h" | 33 #include "bindings/core/v8/ScriptWrappableVisitor.h" |
36 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
37 #include "core/dom/DOMTypedArray.h" | 35 #include "core/dom/DOMTypedArray.h" |
38 #include "core/dom/NotShared.h" | |
39 #include "core/dom/TypedFlexibleArrayBufferView.h" | 36 #include "core/dom/TypedFlexibleArrayBufferView.h" |
40 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 37 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
41 #include "core/html/canvas/CanvasRenderingContext.h" | 38 #include "core/html/canvas/CanvasRenderingContext.h" |
42 #include "core/layout/ContentChangeType.h" | 39 #include "core/layout/ContentChangeType.h" |
43 #include "modules/webgl/WebGLContextAttributes.h" | 40 #include "modules/webgl/WebGLContextAttributes.h" |
44 #include "modules/webgl/WebGLExtensionName.h" | 41 #include "modules/webgl/WebGLExtensionName.h" |
45 #include "modules/webgl/WebGLTexture.h" | 42 #include "modules/webgl/WebGLTexture.h" |
46 #include "modules/webgl/WebGLVertexArrayObjectBase.h" | 43 #include "modules/webgl/WebGLVertexArrayObjectBase.h" |
47 #include "platform/Timer.h" | 44 #include "platform/Timer.h" |
48 #include "platform/graphics/ImageBuffer.h" | 45 #include "platform/graphics/ImageBuffer.h" |
49 #include "platform/graphics/gpu/DrawingBuffer.h" | 46 #include "platform/graphics/gpu/DrawingBuffer.h" |
50 #include "platform/graphics/gpu/Extensions3DUtil.h" | 47 #include "platform/graphics/gpu/Extensions3DUtil.h" |
51 #include "platform/graphics/gpu/WebGLImageConversion.h" | 48 #include "platform/graphics/gpu/WebGLImageConversion.h" |
52 #include "public/platform/Platform.h" | 49 #include "public/platform/Platform.h" |
53 #include "public/platform/WebGraphicsContext3DProvider.h" | 50 #include "public/platform/WebGraphicsContext3DProvider.h" |
54 #include "third_party/khronos/GLES2/gl2.h" | 51 #include "third_party/khronos/GLES2/gl2.h" |
55 #include "wtf/CheckedNumeric.h" | 52 #include "wtf/CheckedNumeric.h" |
56 #include "wtf/text/WTFString.h" | 53 #include "wtf/text/WTFString.h" |
| 54 #include <memory> |
| 55 #include <set> |
57 | 56 |
58 namespace blink { | 57 namespace blink { |
59 class WebLayer; | 58 class WebLayer; |
60 } | 59 } |
61 | 60 |
62 namespace gpu { | 61 namespace gpu { |
63 namespace gles2 { | 62 namespace gles2 { |
64 class GLES2Interface; | 63 class GLES2Interface; |
65 } | 64 } |
66 } | 65 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 void blendEquation(GLenum mode); | 159 void blendEquation(GLenum mode); |
161 void blendEquationSeparate(GLenum mode_rgb, GLenum mode_alpha); | 160 void blendEquationSeparate(GLenum mode_rgb, GLenum mode_alpha); |
162 void blendFunc(GLenum sfactor, GLenum dfactor); | 161 void blendFunc(GLenum sfactor, GLenum dfactor); |
163 void blendFuncSeparate(GLenum src_rgb, | 162 void blendFuncSeparate(GLenum src_rgb, |
164 GLenum dst_rgb, | 163 GLenum dst_rgb, |
165 GLenum src_alpha, | 164 GLenum src_alpha, |
166 GLenum dst_alpha); | 165 GLenum dst_alpha); |
167 | 166 |
168 void bufferData(GLenum target, long long size, GLenum usage); | 167 void bufferData(GLenum target, long long size, GLenum usage); |
169 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); | 168 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); |
170 void bufferData(GLenum target, | 169 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); |
171 NotShared<DOMArrayBufferView> data, | |
172 GLenum usage); | |
173 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); | 170 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); |
174 void bufferSubData(GLenum target, | 171 void bufferSubData(GLenum target, |
175 long long offset, | 172 long long offset, |
176 const FlexibleArrayBufferView& data); | 173 const FlexibleArrayBufferView& data); |
177 | 174 |
178 GLenum checkFramebufferStatus(GLenum target); | 175 GLenum checkFramebufferStatus(GLenum target); |
179 void clear(GLbitfield mask); | 176 void clear(GLbitfield mask); |
180 void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | 177 void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); |
181 void clearDepth(GLfloat); | 178 void clearDepth(GLfloat); |
182 void clearStencil(GLint); | 179 void clearStencil(GLint); |
183 void colorMask(GLboolean red, | 180 void colorMask(GLboolean red, |
184 GLboolean green, | 181 GLboolean green, |
185 GLboolean blue, | 182 GLboolean blue, |
186 GLboolean alpha); | 183 GLboolean alpha); |
187 void compileShader(WebGLShader*); | 184 void compileShader(WebGLShader*); |
188 | 185 |
189 void compressedTexImage2D(GLenum target, | 186 void compressedTexImage2D(GLenum target, |
190 GLint level, | 187 GLint level, |
191 GLenum internalformat, | 188 GLenum internalformat, |
192 GLsizei width, | 189 GLsizei width, |
193 GLsizei height, | 190 GLsizei height, |
194 GLint border, | 191 GLint border, |
195 NotShared<DOMArrayBufferView> data); | 192 DOMArrayBufferView* data); |
196 void compressedTexSubImage2D(GLenum target, | 193 void compressedTexSubImage2D(GLenum target, |
197 GLint level, | 194 GLint level, |
198 GLint xoffset, | 195 GLint xoffset, |
199 GLint yoffset, | 196 GLint yoffset, |
200 GLsizei width, | 197 GLsizei width, |
201 GLsizei height, | 198 GLsizei height, |
202 GLenum format, | 199 GLenum format, |
203 NotShared<DOMArrayBufferView> data); | 200 DOMArrayBufferView* data); |
204 | 201 |
205 void copyTexImage2D(GLenum target, | 202 void copyTexImage2D(GLenum target, |
206 GLint level, | 203 GLint level, |
207 GLenum internalformat, | 204 GLenum internalformat, |
208 GLint x, | 205 GLint x, |
209 GLint y, | 206 GLint y, |
210 GLsizei width, | 207 GLsizei width, |
211 GLsizei height, | 208 GLsizei height, |
212 GLint border); | 209 GLint border); |
213 void copyTexSubImage2D(GLenum target, | 210 void copyTexSubImage2D(GLenum target, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 void lineWidth(GLfloat); | 315 void lineWidth(GLfloat); |
319 void linkProgram(WebGLProgram*); | 316 void linkProgram(WebGLProgram*); |
320 virtual void pixelStorei(GLenum pname, GLint param); | 317 virtual void pixelStorei(GLenum pname, GLint param); |
321 void polygonOffset(GLfloat factor, GLfloat units); | 318 void polygonOffset(GLfloat factor, GLfloat units); |
322 virtual void readPixels(GLint x, | 319 virtual void readPixels(GLint x, |
323 GLint y, | 320 GLint y, |
324 GLsizei width, | 321 GLsizei width, |
325 GLsizei height, | 322 GLsizei height, |
326 GLenum format, | 323 GLenum format, |
327 GLenum type, | 324 GLenum type, |
328 NotShared<DOMArrayBufferView> pixels); | 325 DOMArrayBufferView* pixels); |
329 void renderbufferStorage(GLenum target, | 326 void renderbufferStorage(GLenum target, |
330 GLenum internalformat, | 327 GLenum internalformat, |
331 GLsizei width, | 328 GLsizei width, |
332 GLsizei height); | 329 GLsizei height); |
333 void sampleCoverage(GLfloat value, GLboolean invert); | 330 void sampleCoverage(GLfloat value, GLboolean invert); |
334 void scissor(GLint x, GLint y, GLsizei width, GLsizei height); | 331 void scissor(GLint x, GLint y, GLsizei width, GLsizei height); |
335 void shaderSource(WebGLShader*, const String&); | 332 void shaderSource(WebGLShader*, const String&); |
336 void stencilFunc(GLenum func, GLint ref, GLuint mask); | 333 void stencilFunc(GLenum func, GLint ref, GLuint mask); |
337 void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); | 334 void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); |
338 void stencilMask(GLuint); | 335 void stencilMask(GLuint); |
339 void stencilMaskSeparate(GLenum face, GLuint mask); | 336 void stencilMaskSeparate(GLenum face, GLuint mask); |
340 void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); | 337 void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); |
341 void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); | 338 void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); |
342 | 339 |
343 void texImage2D(GLenum target, | 340 void texImage2D(GLenum target, |
344 GLint level, | 341 GLint level, |
345 GLint internalformat, | 342 GLint internalformat, |
346 GLsizei width, | 343 GLsizei width, |
347 GLsizei height, | 344 GLsizei height, |
348 GLint border, | 345 GLint border, |
349 GLenum format, | 346 GLenum format, |
350 GLenum type, | 347 GLenum type, |
351 NotShared<DOMArrayBufferView>); | 348 DOMArrayBufferView*); |
352 void texImage2D(GLenum target, | 349 void texImage2D(GLenum target, |
353 GLint level, | 350 GLint level, |
354 GLint internalformat, | 351 GLint internalformat, |
355 GLenum format, | 352 GLenum format, |
356 GLenum type, | 353 GLenum type, |
357 ImageData*); | 354 ImageData*); |
358 void texImage2D(GLenum target, | 355 void texImage2D(GLenum target, |
359 GLint level, | 356 GLint level, |
360 GLint internalformat, | 357 GLint internalformat, |
361 GLenum format, | 358 GLenum format, |
(...skipping 26 matching lines...) Expand all Loading... |
388 void texParameteri(GLenum target, GLenum pname, GLint param); | 385 void texParameteri(GLenum target, GLenum pname, GLint param); |
389 | 386 |
390 void texSubImage2D(GLenum target, | 387 void texSubImage2D(GLenum target, |
391 GLint level, | 388 GLint level, |
392 GLint xoffset, | 389 GLint xoffset, |
393 GLint yoffset, | 390 GLint yoffset, |
394 GLsizei width, | 391 GLsizei width, |
395 GLsizei height, | 392 GLsizei height, |
396 GLenum format, | 393 GLenum format, |
397 GLenum type, | 394 GLenum type, |
398 NotShared<DOMArrayBufferView>); | 395 DOMArrayBufferView*); |
399 void texSubImage2D(GLenum target, | 396 void texSubImage2D(GLenum target, |
400 GLint level, | 397 GLint level, |
401 GLint xoffset, | 398 GLint xoffset, |
402 GLint yoffset, | 399 GLint yoffset, |
403 GLenum format, | 400 GLenum format, |
404 GLenum type, | 401 GLenum type, |
405 ImageData*); | 402 ImageData*); |
406 void texSubImage2D(GLenum target, | 403 void texSubImage2D(GLenum target, |
407 GLint level, | 404 GLint level, |
408 GLint xoffset, | 405 GLint xoffset, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 void uniform4fv(const WebGLUniformLocation*, Vector<GLfloat>&); | 460 void uniform4fv(const WebGLUniformLocation*, Vector<GLfloat>&); |
464 void uniform4i(const WebGLUniformLocation*, | 461 void uniform4i(const WebGLUniformLocation*, |
465 GLint x, | 462 GLint x, |
466 GLint y, | 463 GLint y, |
467 GLint z, | 464 GLint z, |
468 GLint w); | 465 GLint w); |
469 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); | 466 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
470 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); | 467 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); |
471 void uniformMatrix2fv(const WebGLUniformLocation*, | 468 void uniformMatrix2fv(const WebGLUniformLocation*, |
472 GLboolean transpose, | 469 GLboolean transpose, |
473 NotShared<DOMFloat32Array> value); | 470 DOMFloat32Array* value); |
474 void uniformMatrix2fv(const WebGLUniformLocation*, | 471 void uniformMatrix2fv(const WebGLUniformLocation*, |
475 GLboolean transpose, | 472 GLboolean transpose, |
476 Vector<GLfloat>& value); | 473 Vector<GLfloat>& value); |
477 void uniformMatrix3fv(const WebGLUniformLocation*, | 474 void uniformMatrix3fv(const WebGLUniformLocation*, |
478 GLboolean transpose, | 475 GLboolean transpose, |
479 NotShared<DOMFloat32Array> value); | 476 DOMFloat32Array* value); |
480 void uniformMatrix3fv(const WebGLUniformLocation*, | 477 void uniformMatrix3fv(const WebGLUniformLocation*, |
481 GLboolean transpose, | 478 GLboolean transpose, |
482 Vector<GLfloat>& value); | 479 Vector<GLfloat>& value); |
483 void uniformMatrix4fv(const WebGLUniformLocation*, | 480 void uniformMatrix4fv(const WebGLUniformLocation*, |
484 GLboolean transpose, | 481 GLboolean transpose, |
485 NotShared<DOMFloat32Array> value); | 482 DOMFloat32Array* value); |
486 void uniformMatrix4fv(const WebGLUniformLocation*, | 483 void uniformMatrix4fv(const WebGLUniformLocation*, |
487 GLboolean transpose, | 484 GLboolean transpose, |
488 Vector<GLfloat>& value); | 485 Vector<GLfloat>& value); |
489 | 486 |
490 void useProgram(WebGLProgram*); | 487 void useProgram(WebGLProgram*); |
491 void validateProgram(WebGLProgram*); | 488 void validateProgram(WebGLProgram*); |
492 | 489 |
493 void vertexAttrib1f(GLuint index, GLfloat x); | 490 void vertexAttrib1f(GLuint index, GLfloat x); |
494 void vertexAttrib1fv(GLuint index, NotShared<const DOMFloat32Array> values); | 491 void vertexAttrib1fv(GLuint index, const DOMFloat32Array* values); |
495 void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); | 492 void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); |
496 void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); | 493 void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); |
497 void vertexAttrib2fv(GLuint index, NotShared<const DOMFloat32Array> values); | 494 void vertexAttrib2fv(GLuint index, const DOMFloat32Array* values); |
498 void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); | 495 void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); |
499 void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); | 496 void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); |
500 void vertexAttrib3fv(GLuint index, NotShared<const DOMFloat32Array> values); | 497 void vertexAttrib3fv(GLuint index, const DOMFloat32Array* values); |
501 void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); | 498 void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); |
502 void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); | 499 void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); |
503 void vertexAttrib4fv(GLuint index, NotShared<const DOMFloat32Array> values); | 500 void vertexAttrib4fv(GLuint index, const DOMFloat32Array* values); |
504 void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); | 501 void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); |
505 void vertexAttribPointer(GLuint index, | 502 void vertexAttribPointer(GLuint index, |
506 GLint size, | 503 GLint size, |
507 GLenum type, | 504 GLenum type, |
508 GLboolean normalized, | 505 GLboolean normalized, |
509 GLsizei stride, | 506 GLsizei stride, |
510 long long offset); | 507 long long offset); |
511 | 508 |
512 void VertexAttribDivisorANGLE(GLuint index, GLuint divisor); | 509 void VertexAttribDivisorANGLE(GLuint index, GLuint divisor); |
513 | 510 |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 context, | 1670 context, |
1674 context->Is3d(), | 1671 context->Is3d(), |
1675 context.Is3d()); | 1672 context.Is3d()); |
1676 | 1673 |
1677 } // namespace blink | 1674 } // namespace blink |
1678 | 1675 |
1679 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( | 1676 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( |
1680 blink::WebGLRenderingContextBase::TextureUnitState); | 1677 blink::WebGLRenderingContextBase::TextureUnitState); |
1681 | 1678 |
1682 #endif // WebGLRenderingContextBase_h | 1679 #endif // WebGLRenderingContextBase_h |
OLD | NEW |