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

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

Issue 2495953002: Support uploads of sub-rectangles of canvases to 2D and 3D textures. (Closed)
Patch Set: Fixed regression in accelerated video-to-texture uploads. Marked Mac Intel failures. Created 4 years, 1 month 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 d50f46b6dd73757a7ae7a303e29af45b62a0f792..bd471478aaf5c982a19c3fe5d1919a8fa7d1f3a6 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -1023,6 +1023,12 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
const IntRect&,
GLsizei depth,
GLint unpackImageHeight);
+
+ template <typename T>
+ IntRect getTextureSourceSize(T* textureSource) {
+ return IntRect(0, 0, textureSource->width(), textureSource->height());
+ }
+
template <typename T>
bool validateTexImageSubRectangle(const char* functionName,
TexImageFunctionID functionID,
@@ -1083,7 +1089,7 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
}
// Copy from the source directly to the texture via the gpu, without a
- // read-back to system memory. Souce could be canvas or imageBitmap.
+ // read-back to system memory. Source could be canvas or imageBitmap.
void texImageByGPU(TexImageByGPUType,
WebGLTexture*,
GLenum target,
@@ -1093,7 +1099,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
GLint xoffset,
GLint yoffset,
GLint zoffset,
- CanvasImageSource*);
+ CanvasImageSource*,
+ const IntRect& sourceSubRectangle);
virtual bool canUseTexImageByGPU(TexImageFunctionID,
GLint internalformat,
GLenum type);
@@ -1566,6 +1573,9 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
GLint,
GLint,
HTMLCanvasElement*,
+ const IntRect&,
+ GLsizei,
+ GLint,
ExceptionState&);
void texImageHelperHTMLVideoElement(TexImageFunctionID,
GLenum,
@@ -1615,7 +1625,14 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
ScriptState*,
const CanvasContextCreationAttributes&,
unsigned);
- void texImageCanvasByGPU(HTMLCanvasElement*, GLuint, GLenum, GLenum, GLint);
+ void texImageCanvasByGPU(HTMLCanvasElement*,
+ GLuint,
+ GLenum,
+ GLenum,
+ GLint,
+ GLint,
+ GLint,
+ const IntRect& sourceSubRectangle);
void texImageBitmapByGPU(ImageBitmap*, GLuint, GLenum, GLenum, GLint, bool);
const unsigned m_version;

Powered by Google App Engine
This is Rietveld 408576698