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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 GLboolean isProgram(WebGLProgram*); | 243 GLboolean isProgram(WebGLProgram*); |
244 GLboolean isRenderbuffer(WebGLRenderbuffer*); | 244 GLboolean isRenderbuffer(WebGLRenderbuffer*); |
245 GLboolean isShader(WebGLShader*); | 245 GLboolean isShader(WebGLShader*); |
246 GLboolean isTexture(WebGLTexture*); | 246 GLboolean isTexture(WebGLTexture*); |
247 | 247 |
248 void lineWidth(GLfloat); | 248 void lineWidth(GLfloat); |
249 void linkProgram(WebGLProgram*); | 249 void linkProgram(WebGLProgram*); |
250 void pixelStorei(GLenum pname, GLint param); | 250 void pixelStorei(GLenum pname, GLint param); |
251 void polygonOffset(GLfloat factor, GLfloat units); | 251 void polygonOffset(GLfloat factor, GLfloat units); |
252 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form
at, GLenum type, DOMArrayBufferView* pixels); | 252 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form
at, GLenum type, DOMArrayBufferView* pixels); |
| 253 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form
at, GLenum type, long long offset); |
253 void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width
, GLsizei height); | 254 void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width
, GLsizei height); |
254 void sampleCoverage(GLfloat value, GLboolean invert); | 255 void sampleCoverage(GLfloat value, GLboolean invert); |
255 void scissor(GLint x, GLint y, GLsizei width, GLsizei height); | 256 void scissor(GLint x, GLint y, GLsizei width, GLsizei height); |
256 void shaderSource(WebGLShader*, const String&); | 257 void shaderSource(WebGLShader*, const String&); |
257 void stencilFunc(GLenum func, GLint ref, GLuint mask); | 258 void stencilFunc(GLenum func, GLint ref, GLuint mask); |
258 void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); | 259 void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); |
259 void stencilMask(GLuint); | 260 void stencilMask(GLuint); |
260 void stencilMaskSeparate(GLenum face, GLuint mask); | 261 void stencilMaskSeparate(GLenum face, GLuint mask); |
261 void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); | 262 void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); |
262 void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
; | 263 void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 483 |
483 bool m_markedCanvasDirty; | 484 bool m_markedCanvasDirty; |
484 PersistentHeapHashSetWillBeHeapHashSet<WeakMember<WebGLContextObject>> m_con
textObjects; | 485 PersistentHeapHashSetWillBeHeapHashSet<WeakMember<WebGLContextObject>> m_con
textObjects; |
485 | 486 |
486 PersistentWillBeMember<WebGLRenderingContextLostCallback> m_contextLostCallb
ackAdapter; | 487 PersistentWillBeMember<WebGLRenderingContextLostCallback> m_contextLostCallb
ackAdapter; |
487 PersistentWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMes
sageCallbackAdapter; | 488 PersistentWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMes
sageCallbackAdapter; |
488 | 489 |
489 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER | 490 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER |
490 PersistentWillBeMember<WebGLBuffer> m_boundArrayBuffer; | 491 PersistentWillBeMember<WebGLBuffer> m_boundArrayBuffer; |
491 | 492 |
| 493 PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; |
| 494 |
492 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObjec
t; | 495 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObjec
t; |
493 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; | 496 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; |
494 void setBoundVertexArrayObject(WebGLVertexArrayObjectBase* arrayObject) | 497 void setBoundVertexArrayObject(WebGLVertexArrayObjectBase* arrayObject) |
495 { | 498 { |
496 if (arrayObject) | 499 if (arrayObject) |
497 m_boundVertexArrayObject = arrayObject; | 500 m_boundVertexArrayObject = arrayObject; |
498 else | 501 else |
499 m_boundVertexArrayObject = m_defaultVertexArrayObject; | 502 m_boundVertexArrayObject = m_defaultVertexArrayObject; |
500 } | 503 } |
501 | 504 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 // Generates INVALID_ENUM and returns false if parameters are invalid. | 817 // Generates INVALID_ENUM and returns false if parameters are invalid. |
815 virtual bool validateReadPixelsFormatAndType(GLenum format, GLenum type); | 818 virtual bool validateReadPixelsFormatAndType(GLenum format, GLenum type); |
816 | 819 |
817 // Helper function to get expected ArrayBuffer view type for readPixels. | 820 // Helper function to get expected ArrayBuffer view type for readPixels. |
818 virtual DOMArrayBufferView::ViewType readPixelsExpectedArrayBufferViewType(G
Lenum type); | 821 virtual DOMArrayBufferView::ViewType readPixelsExpectedArrayBufferViewType(G
Lenum type); |
819 | 822 |
820 // Helper function to check format/type combination for readPixels. | 823 // Helper function to check format/type combination for readPixels. |
821 // Generates INVALID_OPERATION and returns false if the combination is unsup
ported. | 824 // Generates INVALID_OPERATION and returns false if the combination is unsup
ported. |
822 bool validateReadPixelsFormatTypeCombination(GLenum format, GLenum type, GLe
num readBufferInternalFormat, GLenum readBufferType); | 825 bool validateReadPixelsFormatTypeCombination(GLenum format, GLenum type, GLe
num readBufferInternalFormat, GLenum readBufferType); |
823 | 826 |
| 827 // Helper function to check parameters of readPixels. Returns true if all pa
rameters |
| 828 // are valid. Otherwise, generates appropriate error and returns false. |
| 829 bool validateReadPixelsFuncParameters(GLsizei width, GLsizei height, GLenum
format, GLenum type, unsigned domArrayBufferLength, WebGLFramebuffer*& readFrame
bufferBinding); |
| 830 |
824 virtual GLint getMaxTextureLevelForTarget(GLenum target); | 831 virtual GLint getMaxTextureLevelForTarget(GLenum target); |
825 | 832 |
826 // Helper function to check input level for functions {copy}Tex{Sub}Image. | 833 // Helper function to check input level for functions {copy}Tex{Sub}Image. |
827 // Generates GL error and returns false if level is invalid. | 834 // Generates GL error and returns false if level is invalid. |
828 bool validateTexFuncLevel(const char* functionName, GLenum target, GLint lev
el); | 835 bool validateTexFuncLevel(const char* functionName, GLenum target, GLint lev
el); |
829 | 836 |
830 // Helper function to check if a 64-bit value is non-negative and can fit in
to a 32-bit integer. | 837 // Helper function to check if a 64-bit value is non-negative and can fit in
to a 32-bit integer. |
831 // Generates GL error and returns false if not. | 838 // Generates GL error and returns false if not. |
832 bool validateValueFitNonNegInt32(const char* functionName, const char* param
Name, long long value); | 839 bool validateValueFitNonNegInt32(const char* functionName, const char* param
Name, long long value); |
833 | 840 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 static IntSize oldestContextSize(); | 1046 static IntSize oldestContextSize(); |
1040 }; | 1047 }; |
1041 | 1048 |
1042 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 1049 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
1043 | 1050 |
1044 } // namespace blink | 1051 } // namespace blink |
1045 | 1052 |
1046 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 1053 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
1047 | 1054 |
1048 #endif // WebGLRenderingContextBase_h | 1055 #endif // WebGLRenderingContextBase_h |
OLD | NEW |