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

Unified Diff: cc/resources/resource_provider.cc

Issue 184233002: Fix the issue that it may get wrong stride in cc::ResourceProvider::MapImage. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: change error hints and run "git cl format" Created 6 years, 10 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
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 123d7f43d335b07fceb969dc2d3b8ea17f7a57a3..e228ca9da12c9f22cee24f6eae908caab7cd8549 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -2149,10 +2149,12 @@ uint8_t* ResourceProvider::MapImage(const Resource* resource, int* stride) {
DCHECK(resource->image_id);
GLES2Interface* gl = ContextGL();
DCHECK(gl);
+ // MapImageCHROMIUM should be called prior to GetImageParameterivCHROMIUM.
+ uint8_t* pixels = static_cast<uint8_t*>(
+ gl->MapImageCHROMIUM(resource->image_id, GL_READ_WRITE));
gl->GetImageParameterivCHROMIUM(
resource->image_id, GL_IMAGE_ROWBYTES_CHROMIUM, stride);
- return static_cast<uint8_t*>(
- gl->MapImageCHROMIUM(resource->image_id, GL_READ_WRITE));
+ return pixels;
}
DCHECK_EQ(Bitmap, resource->type);
*stride = 0;
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698