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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

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/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index ea452ae747adb9a8e0457ed6de85f77db5de6c32..4023f3420e751291d9cc97de1e9cabda9e7bc632 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -674,6 +674,8 @@ bool DrawingBuffer::copyToPlatformTexture(gpu::gles2::GLES2Interface* gl,
GLint level,
bool premultiplyAlpha,
bool flipY,
+ const IntPoint& destTextureOffset,
+ const IntRect& sourceSubRectangle,
SourceDrawingBuffer sourceBuffer) {
ScopedStateRestorer scopedStateRestorer(this);
@@ -719,9 +721,11 @@ bool DrawingBuffer::copyToPlatformTexture(gpu::gles2::GLES2Interface* gl,
else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha)
unpackPremultiplyAlphaNeeded = GL_TRUE;
- gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType,
- flipY, unpackPremultiplyAlphaNeeded,
- unpackUnpremultiplyAlphaNeeded);
+ gl->CopySubTextureCHROMIUM(
+ sourceTexture, texture, destTextureOffset.x(), destTextureOffset.y(),
+ sourceSubRectangle.x(), sourceSubRectangle.y(),
+ sourceSubRectangle.width(), sourceSubRectangle.height(), flipY,
+ unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded);
gl->DeleteTextures(1, &sourceTexture);

Powered by Google App Engine
This is Rietveld 408576698