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

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

Issue 2489203002: support uploading sub-rectangles of ImageData (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index 55c119ff5beb60e129236c187fe9b42a22e28332..7e3f4a3c1f8867e5b4312ded0310f5efae162eaf 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -2897,6 +2897,7 @@ bool WebGLImageConversion::packImageData(Image* image,
bool WebGLImageConversion::extractImageData(const uint8_t* imageData,
DataFormat sourceDataFormat,
const IntSize& imageDataSize,
+ const IntRect& sourceImageSubRect,
GLenum format,
GLenum type,
bool flipY,
@@ -2911,13 +2912,14 @@ bool WebGLImageConversion::extractImageData(const uint8_t* imageData,
// Output data is tightly packed (alignment == 1).
PixelStoreParams params;
params.alignment = 1;
- if (computeImageSizeInBytes(format, type, width, height, 1, params,
+ if (computeImageSizeInBytes(format, type, sourceImageSubRect.width(),
+ sourceImageSubRect.height(), 1, params,
&packedSize, 0, 0) != GL_NO_ERROR)
return false;
data.resize(packedSize);
if (!packPixels(imageData, sourceDataFormat, width, height,
- IntRect(0, 0, width, height), 0, format, type,
+ sourceImageSubRect, 0, format, type,
premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing,
data.data(), flipY))
return false;
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698