Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1048)

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.h

Issue 735623003: WebGL: accelerated texImage2D and texSubImage2D for canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase to ToT, and dropping copiedImage fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/WebGLRenderingContextBase.h
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.h b/Source/core/html/canvas/WebGLRenderingContextBase.h
index c3b0fa128e4e79f5e292362425a9efdc794445dd..38c58db2916edecd37ac912a9eacf6857a440b15 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.h
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.h
@@ -742,6 +742,14 @@ protected:
void texSubImage2DBase(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels, ExceptionState&);
void texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha, ExceptionState&);
+ enum TexImageFunctionType {
+ NotTexSubImage2D,
+ TexSubImage2D,
+ };
+ // Copy from the canvas element directly to the texture via the GPU, without a read-back to system memory.
+ void texImage2DCanvasByGPU(TexImageFunctionType, WebGLTexture*, GLenum target, GLint level,
+ GLenum internalformat, GLenum type, GLint xoffset, GLint yoffset, HTMLCanvasElement*);
+
void handleTextureCompleteness(const char*, bool);
void createFallbackBlackTextures1x1();
@@ -781,11 +789,6 @@ protected:
// Generates GL error and returns false if not.
bool validateValueFitNonNegInt32(const char* functionName, const char* paramName, long long value);
- enum TexFuncValidationFunctionType {
- NotTexSubImage2D,
- TexSubImage2D,
- };
-
enum TexFuncValidationSourceType {
SourceArrayBufferView,
SourceImageData,
@@ -796,16 +799,16 @@ protected:
// Helper function for tex{Sub}Image2D to check if the input format/type/level/target/width/height/border/xoffset/yoffset are valid.
// Otherwise, it would return quickly without doing other work.
- bool validateTexFunc(const char* functionName, TexFuncValidationFunctionType, TexFuncValidationSourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width,
+ bool validateTexFunc(const char* functionName, TexImageFunctionType, TexFuncValidationSourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width,
GLsizei height, GLint border, GLenum format, GLenum type, GLint xoffset, GLint yoffset);
// Helper function to check input width and height for functions {copy, compressed}Tex{Sub}Image.
// Generates GL error and returns false if width or height is invalid.
- bool validateTexFuncDimensions(const char* functionName, TexFuncValidationFunctionType, GLenum target, GLint level, GLsizei width, GLsizei height);
+ bool validateTexFuncDimensions(const char* functionName, TexImageFunctionType, GLenum target, GLint level, GLsizei width, GLsizei height);
// Helper function to check input parameters for functions {copy}Tex{Sub}Image.
// Generates GL error and returns false if parameters are invalid.
- bool validateTexFuncParameters(const char* functionName, TexFuncValidationFunctionType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type);
+ bool validateTexFuncParameters(const char* functionName, TexImageFunctionType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type);
enum NullDisposition {
NullAllowed,
@@ -832,7 +835,7 @@ protected:
// Helper function to validate compressed texture dimensions are valid for
// the given format.
- bool validateCompressedTexDimensions(const char* functionName, TexFuncValidationFunctionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format);
+ bool validateCompressedTexDimensions(const char* functionName, TexImageFunctionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format);
// Helper function to validate compressed texture dimensions are valid for
// the given format.

Powered by Google App Engine
This is Rietveld 408576698