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> |
29 #include "bindings/core/v8/Nullable.h" | 31 #include "bindings/core/v8/Nullable.h" |
30 #include "bindings/core/v8/ScriptState.h" | 32 #include "bindings/core/v8/ScriptState.h" |
31 #include "bindings/core/v8/ScriptValue.h" | 33 #include "bindings/core/v8/ScriptValue.h" |
32 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "bindings/core/v8/ScriptWrappable.h" |
33 #include "bindings/core/v8/ScriptWrappableVisitor.h" | 35 #include "bindings/core/v8/ScriptWrappableVisitor.h" |
34 #include "core/CoreExport.h" | 36 #include "core/CoreExport.h" |
35 #include "core/dom/DOMTypedArray.h" | 37 #include "core/dom/DOMTypedArray.h" |
| 38 #include "core/dom/NotShared.h" |
36 #include "core/dom/TypedFlexibleArrayBufferView.h" | 39 #include "core/dom/TypedFlexibleArrayBufferView.h" |
37 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 40 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
38 #include "core/html/canvas/CanvasRenderingContext.h" | 41 #include "core/html/canvas/CanvasRenderingContext.h" |
39 #include "core/layout/ContentChangeType.h" | 42 #include "core/layout/ContentChangeType.h" |
40 #include "modules/webgl/WebGLContextAttributes.h" | 43 #include "modules/webgl/WebGLContextAttributes.h" |
41 #include "modules/webgl/WebGLExtensionName.h" | 44 #include "modules/webgl/WebGLExtensionName.h" |
42 #include "modules/webgl/WebGLTexture.h" | 45 #include "modules/webgl/WebGLTexture.h" |
43 #include "modules/webgl/WebGLVertexArrayObjectBase.h" | 46 #include "modules/webgl/WebGLVertexArrayObjectBase.h" |
44 #include "platform/Timer.h" | 47 #include "platform/Timer.h" |
45 #include "platform/graphics/ImageBuffer.h" | 48 #include "platform/graphics/ImageBuffer.h" |
46 #include "platform/graphics/gpu/DrawingBuffer.h" | 49 #include "platform/graphics/gpu/DrawingBuffer.h" |
47 #include "platform/graphics/gpu/Extensions3DUtil.h" | 50 #include "platform/graphics/gpu/Extensions3DUtil.h" |
48 #include "platform/graphics/gpu/WebGLImageConversion.h" | 51 #include "platform/graphics/gpu/WebGLImageConversion.h" |
49 #include "public/platform/Platform.h" | 52 #include "public/platform/Platform.h" |
50 #include "public/platform/WebGraphicsContext3DProvider.h" | 53 #include "public/platform/WebGraphicsContext3DProvider.h" |
51 #include "third_party/khronos/GLES2/gl2.h" | 54 #include "third_party/khronos/GLES2/gl2.h" |
52 #include "wtf/CheckedNumeric.h" | 55 #include "wtf/CheckedNumeric.h" |
53 #include "wtf/text/WTFString.h" | 56 #include "wtf/text/WTFString.h" |
54 #include <memory> | |
55 #include <set> | |
56 | 57 |
57 namespace blink { | 58 namespace blink { |
58 class WebLayer; | 59 class WebLayer; |
59 } | 60 } |
60 | 61 |
61 namespace gpu { | 62 namespace gpu { |
62 namespace gles2 { | 63 namespace gles2 { |
63 class GLES2Interface; | 64 class GLES2Interface; |
64 } | 65 } |
65 } | 66 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void blendEquation(GLenum mode); | 160 void blendEquation(GLenum mode); |
160 void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); | 161 void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); |
161 void blendFunc(GLenum sfactor, GLenum dfactor); | 162 void blendFunc(GLenum sfactor, GLenum dfactor); |
162 void blendFuncSeparate(GLenum srcRGB, | 163 void blendFuncSeparate(GLenum srcRGB, |
163 GLenum dstRGB, | 164 GLenum dstRGB, |
164 GLenum srcAlpha, | 165 GLenum srcAlpha, |
165 GLenum dstAlpha); | 166 GLenum dstAlpha); |
166 | 167 |
167 void bufferData(GLenum target, long long size, GLenum usage); | 168 void bufferData(GLenum target, long long size, GLenum usage); |
168 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); | 169 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); |
169 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); | 170 void bufferData(GLenum target, |
| 171 const NotShared<DOMArrayBufferView>& data, |
| 172 GLenum usage); |
170 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); | 173 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); |
171 void bufferSubData(GLenum target, | 174 void bufferSubData(GLenum target, |
172 long long offset, | 175 long long offset, |
173 const FlexibleArrayBufferView& data); | 176 const FlexibleArrayBufferView& data); |
174 | 177 |
175 GLenum checkFramebufferStatus(GLenum target); | 178 GLenum checkFramebufferStatus(GLenum target); |
176 void clear(GLbitfield mask); | 179 void clear(GLbitfield mask); |
177 void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | 180 void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); |
178 void clearDepth(GLfloat); | 181 void clearDepth(GLfloat); |
179 void clearStencil(GLint); | 182 void clearStencil(GLint); |
180 void colorMask(GLboolean red, | 183 void colorMask(GLboolean red, |
181 GLboolean green, | 184 GLboolean green, |
182 GLboolean blue, | 185 GLboolean blue, |
183 GLboolean alpha); | 186 GLboolean alpha); |
184 void compileShader(WebGLShader*); | 187 void compileShader(WebGLShader*); |
185 | 188 |
186 void compressedTexImage2D(GLenum target, | 189 void compressedTexImage2D(GLenum target, |
187 GLint level, | 190 GLint level, |
188 GLenum internalformat, | 191 GLenum internalformat, |
189 GLsizei width, | 192 GLsizei width, |
190 GLsizei height, | 193 GLsizei height, |
191 GLint border, | 194 GLint border, |
192 DOMArrayBufferView* data); | 195 const NotShared<DOMArrayBufferView>& data); |
193 void compressedTexSubImage2D(GLenum target, | 196 void compressedTexSubImage2D(GLenum target, |
194 GLint level, | 197 GLint level, |
195 GLint xoffset, | 198 GLint xoffset, |
196 GLint yoffset, | 199 GLint yoffset, |
197 GLsizei width, | 200 GLsizei width, |
198 GLsizei height, | 201 GLsizei height, |
199 GLenum format, | 202 GLenum format, |
200 DOMArrayBufferView* data); | 203 const NotShared<DOMArrayBufferView>& data); |
201 | 204 |
202 void copyTexImage2D(GLenum target, | 205 void copyTexImage2D(GLenum target, |
203 GLint level, | 206 GLint level, |
204 GLenum internalformat, | 207 GLenum internalformat, |
205 GLint x, | 208 GLint x, |
206 GLint y, | 209 GLint y, |
207 GLsizei width, | 210 GLsizei width, |
208 GLsizei height, | 211 GLsizei height, |
209 GLint border); | 212 GLint border); |
210 void copyTexSubImage2D(GLenum target, | 213 void copyTexSubImage2D(GLenum target, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 void lineWidth(GLfloat); | 318 void lineWidth(GLfloat); |
316 void linkProgram(WebGLProgram*); | 319 void linkProgram(WebGLProgram*); |
317 virtual void pixelStorei(GLenum pname, GLint param); | 320 virtual void pixelStorei(GLenum pname, GLint param); |
318 void polygonOffset(GLfloat factor, GLfloat units); | 321 void polygonOffset(GLfloat factor, GLfloat units); |
319 virtual void readPixels(GLint x, | 322 virtual void readPixels(GLint x, |
320 GLint y, | 323 GLint y, |
321 GLsizei width, | 324 GLsizei width, |
322 GLsizei height, | 325 GLsizei height, |
323 GLenum format, | 326 GLenum format, |
324 GLenum type, | 327 GLenum type, |
325 DOMArrayBufferView* pixels); | 328 const NotShared<DOMArrayBufferView>& pixels); |
326 void renderbufferStorage(GLenum target, | 329 void renderbufferStorage(GLenum target, |
327 GLenum internalformat, | 330 GLenum internalformat, |
328 GLsizei width, | 331 GLsizei width, |
329 GLsizei height); | 332 GLsizei height); |
330 void sampleCoverage(GLfloat value, GLboolean invert); | 333 void sampleCoverage(GLfloat value, GLboolean invert); |
331 void scissor(GLint x, GLint y, GLsizei width, GLsizei height); | 334 void scissor(GLint x, GLint y, GLsizei width, GLsizei height); |
332 void shaderSource(WebGLShader*, const String&); | 335 void shaderSource(WebGLShader*, const String&); |
333 void stencilFunc(GLenum func, GLint ref, GLuint mask); | 336 void stencilFunc(GLenum func, GLint ref, GLuint mask); |
334 void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); | 337 void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); |
335 void stencilMask(GLuint); | 338 void stencilMask(GLuint); |
336 void stencilMaskSeparate(GLenum face, GLuint mask); | 339 void stencilMaskSeparate(GLenum face, GLuint mask); |
337 void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); | 340 void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); |
338 void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); | 341 void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); |
339 | 342 |
340 void texImage2D(GLenum target, | 343 void texImage2D(GLenum target, |
341 GLint level, | 344 GLint level, |
342 GLint internalformat, | 345 GLint internalformat, |
343 GLsizei width, | 346 GLsizei width, |
344 GLsizei height, | 347 GLsizei height, |
345 GLint border, | 348 GLint border, |
346 GLenum format, | 349 GLenum format, |
347 GLenum type, | 350 GLenum type, |
348 DOMArrayBufferView*); | 351 const NotShared<DOMArrayBufferView>&); |
349 void texImage2D(GLenum target, | 352 void texImage2D(GLenum target, |
350 GLint level, | 353 GLint level, |
351 GLint internalformat, | 354 GLint internalformat, |
352 GLenum format, | 355 GLenum format, |
353 GLenum type, | 356 GLenum type, |
354 ImageData*); | 357 ImageData*); |
355 void texImage2D(GLenum target, | 358 void texImage2D(GLenum target, |
356 GLint level, | 359 GLint level, |
357 GLint internalformat, | 360 GLint internalformat, |
358 GLenum format, | 361 GLenum format, |
(...skipping 26 matching lines...) Expand all Loading... |
385 void texParameteri(GLenum target, GLenum pname, GLint param); | 388 void texParameteri(GLenum target, GLenum pname, GLint param); |
386 | 389 |
387 void texSubImage2D(GLenum target, | 390 void texSubImage2D(GLenum target, |
388 GLint level, | 391 GLint level, |
389 GLint xoffset, | 392 GLint xoffset, |
390 GLint yoffset, | 393 GLint yoffset, |
391 GLsizei width, | 394 GLsizei width, |
392 GLsizei height, | 395 GLsizei height, |
393 GLenum format, | 396 GLenum format, |
394 GLenum type, | 397 GLenum type, |
395 DOMArrayBufferView*); | 398 const NotShared<DOMArrayBufferView>&); |
396 void texSubImage2D(GLenum target, | 399 void texSubImage2D(GLenum target, |
397 GLint level, | 400 GLint level, |
398 GLint xoffset, | 401 GLint xoffset, |
399 GLint yoffset, | 402 GLint yoffset, |
400 GLenum format, | 403 GLenum format, |
401 GLenum type, | 404 GLenum type, |
402 ImageData*); | 405 ImageData*); |
403 void texSubImage2D(GLenum target, | 406 void texSubImage2D(GLenum target, |
404 GLint level, | 407 GLint level, |
405 GLint xoffset, | 408 GLint xoffset, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 void uniform4fv(const WebGLUniformLocation*, Vector<GLfloat>&); | 463 void uniform4fv(const WebGLUniformLocation*, Vector<GLfloat>&); |
461 void uniform4i(const WebGLUniformLocation*, | 464 void uniform4i(const WebGLUniformLocation*, |
462 GLint x, | 465 GLint x, |
463 GLint y, | 466 GLint y, |
464 GLint z, | 467 GLint z, |
465 GLint w); | 468 GLint w); |
466 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); | 469 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
467 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); | 470 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); |
468 void uniformMatrix2fv(const WebGLUniformLocation*, | 471 void uniformMatrix2fv(const WebGLUniformLocation*, |
469 GLboolean transpose, | 472 GLboolean transpose, |
470 DOMFloat32Array* value); | 473 const NotShared<DOMFloat32Array>& value); |
471 void uniformMatrix2fv(const WebGLUniformLocation*, | 474 void uniformMatrix2fv(const WebGLUniformLocation*, |
472 GLboolean transpose, | 475 GLboolean transpose, |
473 Vector<GLfloat>& value); | 476 Vector<GLfloat>& value); |
474 void uniformMatrix3fv(const WebGLUniformLocation*, | 477 void uniformMatrix3fv(const WebGLUniformLocation*, |
475 GLboolean transpose, | 478 GLboolean transpose, |
476 DOMFloat32Array* value); | 479 const NotShared<DOMFloat32Array>& value); |
477 void uniformMatrix3fv(const WebGLUniformLocation*, | 480 void uniformMatrix3fv(const WebGLUniformLocation*, |
478 GLboolean transpose, | 481 GLboolean transpose, |
479 Vector<GLfloat>& value); | 482 Vector<GLfloat>& value); |
480 void uniformMatrix4fv(const WebGLUniformLocation*, | 483 void uniformMatrix4fv(const WebGLUniformLocation*, |
481 GLboolean transpose, | 484 GLboolean transpose, |
482 DOMFloat32Array* value); | 485 const NotShared<DOMFloat32Array>& value); |
483 void uniformMatrix4fv(const WebGLUniformLocation*, | 486 void uniformMatrix4fv(const WebGLUniformLocation*, |
484 GLboolean transpose, | 487 GLboolean transpose, |
485 Vector<GLfloat>& value); | 488 Vector<GLfloat>& value); |
486 | 489 |
487 void useProgram(WebGLProgram*); | 490 void useProgram(WebGLProgram*); |
488 void validateProgram(WebGLProgram*); | 491 void validateProgram(WebGLProgram*); |
489 | 492 |
490 void vertexAttrib1f(GLuint index, GLfloat x); | 493 void vertexAttrib1f(GLuint index, GLfloat x); |
491 void vertexAttrib1fv(GLuint index, const DOMFloat32Array* values); | 494 void vertexAttrib1fv(GLuint index, |
| 495 const NotShared<const DOMFloat32Array>& values); |
492 void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); | 496 void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); |
493 void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); | 497 void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); |
494 void vertexAttrib2fv(GLuint index, const DOMFloat32Array* values); | 498 void vertexAttrib2fv(GLuint index, |
| 499 const NotShared<const DOMFloat32Array>& values); |
495 void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); | 500 void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); |
496 void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); | 501 void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); |
497 void vertexAttrib3fv(GLuint index, const DOMFloat32Array* values); | 502 void vertexAttrib3fv(GLuint index, |
| 503 const NotShared<const DOMFloat32Array>& values); |
498 void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); | 504 void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); |
499 void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); | 505 void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); |
500 void vertexAttrib4fv(GLuint index, const DOMFloat32Array* values); | 506 void vertexAttrib4fv(GLuint index, |
| 507 const NotShared<const DOMFloat32Array>& values); |
501 void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); | 508 void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); |
502 void vertexAttribPointer(GLuint index, | 509 void vertexAttribPointer(GLuint index, |
503 GLint size, | 510 GLint size, |
504 GLenum type, | 511 GLenum type, |
505 GLboolean normalized, | 512 GLboolean normalized, |
506 GLsizei stride, | 513 GLsizei stride, |
507 long long offset); | 514 long long offset); |
508 | 515 |
509 void vertexAttribDivisorANGLE(GLuint index, GLuint divisor); | 516 void vertexAttribDivisorANGLE(GLuint index, GLuint divisor); |
510 | 517 |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 context, | 1672 context, |
1666 context->is3d(), | 1673 context->is3d(), |
1667 context.is3d()); | 1674 context.is3d()); |
1668 | 1675 |
1669 } // namespace blink | 1676 } // namespace blink |
1670 | 1677 |
1671 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( | 1678 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( |
1672 blink::WebGLRenderingContextBase::TextureUnitState); | 1679 blink::WebGLRenderingContextBase::TextureUnitState); |
1673 | 1680 |
1674 #endif // WebGLRenderingContextBase_h | 1681 #endif // WebGLRenderingContextBase_h |
OLD | NEW |