Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h |
index f6738b88b58248e6ae101cf6b1e65dac499bdb38..415275a6e49fd79d9e7b8e165d2f25fcd70b18e3 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h |
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h |
@@ -780,6 +780,12 @@ protected: |
CopyTexImage, |
CompressedTexImage |
}; |
+ enum TexImageFunctionName { |
+ TexImage2D, |
+ TexSubImage2D, |
+ TexImage3D, |
+ TexSubImage3D |
+ }; |
enum TexImageByGPUType { |
TexImage2DByGPU, |
TexSubImage2DByGPU, |
@@ -819,6 +825,9 @@ protected: |
// null. Otherwise, return the texture bound to the target. |
WebGLTexture* validateTextureBinding(const char* functionName, GLenum target); |
+ // Wrapper function for validateTexture2D(3D)Binding, used in texImageHelper functions. |
+ virtual WebGLTexture* validateTexImageBinding(const char*, TexImageFunctionName, GLenum); |
+ |
// Helper function to check texture 2D target and texture bound to the target. |
// Generate GL errors and return 0 if target is invalid or texture bound is |
// null. Otherwise, return the texture bound to the target. |
@@ -1088,6 +1097,16 @@ protected: |
CrossThreadWeakPersistentThisPointer<WebGLRenderingContextBase> createWeakThisPointer() { return CrossThreadWeakPersistentThisPointer<WebGLRenderingContextBase>(this); } |
ImageBitmap* transferToImageBitmapBase(); |
+ |
+ // Helper functions for tex(Sub)Image2D && texSubImage3D |
+ void texImageHelperDOMArrayBufferView(TexImageFunctionName, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, GLsizei, GLint, GLint, GLint, DOMArrayBufferView*); |
+ void texImageHelperImageData(TexImageFunctionName, GLenum, GLint, GLint, GLint, GLenum, GLenum, GLsizei, GLint, GLint, GLint, ImageData*); |
+ bool texImageHelperHTMLImageElement(TexImageFunctionName, GLenum, GLint, GLint, GLenum, GLenum, GLint, GLint, GLint, HTMLImageElement*, ExceptionState&); |
+ WebGLTexture* texImageHelperHTMLCanvasElement(TexImageFunctionName, GLenum, GLint, GLint, GLenum, GLenum, GLint, GLint, GLint, HTMLCanvasElement*, ExceptionState&); |
+ WebGLTexture* texImageHelperHTMLVideoElement(TexImageFunctionName, GLenum, GLint, GLint, GLenum, GLenum, GLint, GLint, GLint, HTMLVideoElement*, ExceptionState&); |
+ void texImageHelperImageBitmap(TexImageFunctionName, GLenum, GLint, GLint, GLenum, GLenum, GLint, GLint, GLint, ImageBitmap*, ExceptionState&); |
+ static const char* getTexImageFunctionName(TexImageFunctionName); |
+ |
private: |
WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&); |
static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderInternal(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned); |