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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 2026803002: Avoid GPU readback in tex(Sub)Image2D(ImageBitmap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: staticbitmapimage does not keep provider anymore Created 4 years, 6 months 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: 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 6a6377ed4f407666959bd0a14f4f30a9f9c859df..c344ac6a18c14524635095d045e9b08d476eb19a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -794,10 +794,11 @@ protected:
void texImageImpl(TexImageFunctionID, GLenum target, GLint level, GLint internalformat, GLint xoffset, GLint yoffset, GLint zoffset,
GLenum format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha);
- // Copy from the canvas element directly to the texture via the GPU, without a read-back to system memory.
- void texImageCanvasByGPU(TexImageByGPUType, WebGLTexture*, GLenum target, GLint level,
- GLint internalformat, GLenum type, GLint xoffset, GLint yoffset, GLint zoffset, HTMLCanvasElement*);
- virtual bool canUseTexImageCanvasByGPU(GLint internalformat, GLenum type);
+ // Copy from the source directly to the texture via the gpu, without a read-back to system memory.
+ // Souce could be canvas or imageBitmap.
+ void texImageByGPU(TexImageByGPUType, WebGLTexture*, GLenum target, GLint level, GLint internalformat,
+ GLenum type, GLint xoffset, GLint yoffset, GLint zoffset, HTMLCanvasElement*, ImageBitmap*);
+ virtual bool canUseTexImageByGPU(GLint internalformat, GLenum type);
virtual WebGLImageConversion::PixelStoreParams getPackPixelStoreParams();
virtual WebGLImageConversion::PixelStoreParams getUnpackPixelStoreParams(TexImageDimension);
@@ -1109,6 +1110,8 @@ protected:
private:
WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&);
static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderInternal(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned);
+ void texImageCanvasByGPU(HTMLCanvasElement*, GLuint, GLenum, GLenum, GLint);
+ void texImageBitmapByGPU(ImageBitmap*, GLuint, GLenum, GLenum, GLint);
};
DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, context->is3d(), context.is3d());

Powered by Google App Engine
This is Rietveld 408576698