| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef WebGLRenderingContextBase_h | 26 #ifndef WebGLRenderingContextBase_h |
| 27 #define WebGLRenderingContextBase_h | 27 #define WebGLRenderingContextBase_h |
| 28 | 28 |
| 29 #include "bindings/core/v8/Nullable.h" | 29 #include "bindings/core/v8/Nullable.h" |
| 30 #include "bindings/core/v8/ScriptState.h" | 30 #include "bindings/core/v8/ScriptState.h" |
| 31 #include "bindings/core/v8/ScriptValue.h" | 31 #include "bindings/core/v8/ScriptValue.h" |
| 32 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
| 33 #include "core/CoreExport.h" | 33 #include "core/CoreExport.h" |
| 34 #include "core/dom/DOMTypedArray.h" | 34 #include "core/dom/DOMTypedArray.h" |
| 35 #include "core/dom/TypedFlexibleArrayBufferView.h" |
| 35 #include "core/html/canvas/CanvasRenderingContext.h" | 36 #include "core/html/canvas/CanvasRenderingContext.h" |
| 36 #include "core/layout/LayoutBoxModelObject.h" | 37 #include "core/layout/LayoutBoxModelObject.h" |
| 37 #include "core/page/Page.h" | 38 #include "core/page/Page.h" |
| 38 #include "modules/webgl/WebGLContextAttributes.h" | 39 #include "modules/webgl/WebGLContextAttributes.h" |
| 39 #include "modules/webgl/WebGLExtensionName.h" | 40 #include "modules/webgl/WebGLExtensionName.h" |
| 40 #include "modules/webgl/WebGLTexture.h" | 41 #include "modules/webgl/WebGLTexture.h" |
| 41 #include "modules/webgl/WebGLVertexArrayObjectBase.h" | 42 #include "modules/webgl/WebGLVertexArrayObjectBase.h" |
| 42 #include "platform/Timer.h" | 43 #include "platform/Timer.h" |
| 43 #include "platform/graphics/GraphicsTypes3D.h" | 44 #include "platform/graphics/GraphicsTypes3D.h" |
| 44 #include "platform/graphics/ImageBuffer.h" | 45 #include "platform/graphics/ImageBuffer.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | 150 void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); |
| 150 void blendEquation(GLenum mode); | 151 void blendEquation(GLenum mode); |
| 151 void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); | 152 void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); |
| 152 void blendFunc(GLenum sfactor, GLenum dfactor); | 153 void blendFunc(GLenum sfactor, GLenum dfactor); |
| 153 void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum
dstAlpha); | 154 void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum
dstAlpha); |
| 154 | 155 |
| 155 void bufferData(GLenum target, long long size, GLenum usage); | 156 void bufferData(GLenum target, long long size, GLenum usage); |
| 156 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); | 157 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); |
| 157 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); | 158 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); |
| 158 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); | 159 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); |
| 159 void bufferSubData(GLenum target, long long offset, DOMArrayBufferView* data
); | 160 void bufferSubData(GLenum target, long long offset, const FlexibleArrayBuffe
rView& data); |
| 160 | 161 |
| 161 GLenum checkFramebufferStatus(GLenum target); | 162 GLenum checkFramebufferStatus(GLenum target); |
| 162 void clear(GLbitfield mask); | 163 void clear(GLbitfield mask); |
| 163 void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | 164 void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); |
| 164 void clearDepth(GLfloat); | 165 void clearDepth(GLfloat); |
| 165 void clearStencil(GLint); | 166 void clearStencil(GLint); |
| 166 void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alp
ha); | 167 void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alp
ha); |
| 167 void compileShader(WebGLShader*); | 168 void compileShader(WebGLShader*); |
| 168 | 169 |
| 169 void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, DOMArrayBufferView* data); | 170 void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, DOMArrayBufferView* data); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, | 282 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
| 282 GLenum format, GLenum type, ImageData*); | 283 GLenum format, GLenum type, ImageData*); |
| 283 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, | 284 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
| 284 GLenum format, GLenum type, HTMLImageElement*, ExceptionState&); | 285 GLenum format, GLenum type, HTMLImageElement*, ExceptionState&); |
| 285 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, | 286 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
| 286 GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&); | 287 GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&); |
| 287 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, | 288 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
| 288 GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); | 289 GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); |
| 289 | 290 |
| 290 void uniform1f(const WebGLUniformLocation*, GLfloat x); | 291 void uniform1f(const WebGLUniformLocation*, GLfloat x); |
| 291 void uniform1fv(const WebGLUniformLocation*, DOMFloat32Array* v); | 292 void uniform1fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView&
); |
| 292 void uniform1fv(const WebGLUniformLocation*, Vector<GLfloat>&); | 293 void uniform1fv(const WebGLUniformLocation*, Vector<GLfloat>&); |
| 293 void uniform1i(const WebGLUniformLocation*, GLint x); | 294 void uniform1i(const WebGLUniformLocation*, GLint x); |
| 294 void uniform1iv(const WebGLUniformLocation*, DOMInt32Array* v); | 295 void uniform1iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
| 295 void uniform1iv(const WebGLUniformLocation*, Vector<GLint>&); | 296 void uniform1iv(const WebGLUniformLocation*, Vector<GLint>&); |
| 296 void uniform2f(const WebGLUniformLocation*, GLfloat x, GLfloat y); | 297 void uniform2f(const WebGLUniformLocation*, GLfloat x, GLfloat y); |
| 297 void uniform2fv(const WebGLUniformLocation*, DOMFloat32Array* v); | 298 void uniform2fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView&
); |
| 298 void uniform2fv(const WebGLUniformLocation*, Vector<GLfloat>&); | 299 void uniform2fv(const WebGLUniformLocation*, Vector<GLfloat>&); |
| 299 void uniform2i(const WebGLUniformLocation*, GLint x, GLint y); | 300 void uniform2i(const WebGLUniformLocation*, GLint x, GLint y); |
| 300 void uniform2iv(const WebGLUniformLocation*, DOMInt32Array* v); | 301 void uniform2iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
| 301 void uniform2iv(const WebGLUniformLocation*, Vector<GLint>&); | 302 void uniform2iv(const WebGLUniformLocation*, Vector<GLint>&); |
| 302 void uniform3f(const WebGLUniformLocation*, GLfloat x, GLfloat y, GLfloat z)
; | 303 void uniform3f(const WebGLUniformLocation*, GLfloat x, GLfloat y, GLfloat z)
; |
| 303 void uniform3fv(const WebGLUniformLocation*, DOMFloat32Array* v); | 304 void uniform3fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView&
); |
| 304 void uniform3fv(const WebGLUniformLocation*, Vector<GLfloat>&); | 305 void uniform3fv(const WebGLUniformLocation*, Vector<GLfloat>&); |
| 305 void uniform3i(const WebGLUniformLocation*, GLint x, GLint y, GLint z); | 306 void uniform3i(const WebGLUniformLocation*, GLint x, GLint y, GLint z); |
| 306 void uniform3iv(const WebGLUniformLocation*, DOMInt32Array* v); | 307 void uniform3iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
| 307 void uniform3iv(const WebGLUniformLocation*, Vector<GLint>&); | 308 void uniform3iv(const WebGLUniformLocation*, Vector<GLint>&); |
| 308 void uniform4f(const WebGLUniformLocation*, GLfloat x, GLfloat y, GLfloat z,
GLfloat w); | 309 void uniform4f(const WebGLUniformLocation*, GLfloat x, GLfloat y, GLfloat z,
GLfloat w); |
| 309 void uniform4fv(const WebGLUniformLocation*, DOMFloat32Array* v); | 310 void uniform4fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView&
); |
| 310 void uniform4fv(const WebGLUniformLocation*, Vector<GLfloat>&); | 311 void uniform4fv(const WebGLUniformLocation*, Vector<GLfloat>&); |
| 311 void uniform4i(const WebGLUniformLocation*, GLint x, GLint y, GLint z, GLint
w); | 312 void uniform4i(const WebGLUniformLocation*, GLint x, GLint y, GLint z, GLint
w); |
| 312 void uniform4iv(const WebGLUniformLocation*, DOMInt32Array* v); | 313 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
| 313 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); | 314 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); |
| 314 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); | 315 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); |
| 315 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); | 316 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); |
| 316 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); | 317 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); |
| 317 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); | 318 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); |
| 318 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); | 319 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); |
| 319 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); | 320 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); |
| 320 | 321 |
| 321 void useProgram(WebGLProgram*); | 322 void useProgram(WebGLProgram*); |
| 322 void validateProgram(WebGLProgram*); | 323 void validateProgram(WebGLProgram*); |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 // Helper function to validate a GL capability. | 932 // Helper function to validate a GL capability. |
| 932 virtual bool validateCapability(const char* functionName, GLenum); | 933 virtual bool validateCapability(const char* functionName, GLenum); |
| 933 | 934 |
| 934 // Helper function to validate input parameters for uniform functions. | 935 // Helper function to validate input parameters for uniform functions. |
| 935 bool validateUniformParameters(const char* functionName, const WebGLUniformL
ocation*, DOMFloat32Array*, GLsizei mod); | 936 bool validateUniformParameters(const char* functionName, const WebGLUniformL
ocation*, DOMFloat32Array*, GLsizei mod); |
| 936 bool validateUniformParameters(const char* functionName, const WebGLUniformL
ocation*, DOMInt32Array*, GLsizei mod); | 937 bool validateUniformParameters(const char* functionName, const WebGLUniformL
ocation*, DOMInt32Array*, GLsizei mod); |
| 937 bool validateUniformParameters(const char* functionName, const WebGLUniformL
ocation*, void*, GLsizei, GLsizei mod); | 938 bool validateUniformParameters(const char* functionName, const WebGLUniformL
ocation*, void*, GLsizei, GLsizei mod); |
| 938 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn
iformLocation*, GLboolean transpose, DOMFloat32Array*, GLsizei mod); | 939 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn
iformLocation*, GLboolean transpose, DOMFloat32Array*, GLsizei mod); |
| 939 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn
iformLocation*, GLboolean transpose, void*, GLsizei, GLsizei mod); | 940 bool validateUniformMatrixParameters(const char* functionName, const WebGLUn
iformLocation*, GLboolean transpose, void*, GLsizei, GLsizei mod); |
| 940 | 941 |
| 942 template<typename WTFTypedArray> |
| 943 bool validateUniformParameters(const char*, const WebGLUniformLocation*, co
nst TypedFlexibleArrayBufferView<WTFTypedArray>&, GLsizei); |
| 944 |
| 941 // Helper function to validate the target for bufferData and getBufferParame
ter. | 945 // Helper function to validate the target for bufferData and getBufferParame
ter. |
| 942 virtual bool validateBufferTarget(const char* functionName, GLenum target); | 946 virtual bool validateBufferTarget(const char* functionName, GLenum target); |
| 943 | 947 |
| 944 // Helper function to validate the target for bufferData. | 948 // Helper function to validate the target for bufferData. |
| 945 // Return the current bound buffer to target, or 0 if the target is invalid. | 949 // Return the current bound buffer to target, or 0 if the target is invalid. |
| 946 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName, GLen
um target); | 950 virtual WebGLBuffer* validateBufferDataTarget(const char* functionName, GLen
um target); |
| 947 | 951 |
| 948 virtual bool validateAndUpdateBufferBindTarget(const char* functionName, GLe
num target, WebGLBuffer*); | 952 virtual bool validateAndUpdateBufferBindTarget(const char* functionName, GLe
num target, WebGLBuffer*); |
| 949 | 953 |
| 950 virtual void removeBoundBuffer(WebGLBuffer*); | 954 virtual void removeBoundBuffer(WebGLBuffer*); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 static IntSize oldestContextSize(); | 1050 static IntSize oldestContextSize(); |
| 1047 }; | 1051 }; |
| 1048 | 1052 |
| 1049 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 1053 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
| 1050 | 1054 |
| 1051 } // namespace blink | 1055 } // namespace blink |
| 1052 | 1056 |
| 1053 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 1057 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
| 1054 | 1058 |
| 1055 #endif // WebGLRenderingContextBase_h | 1059 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |