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

Unified Diff: cc/resources/resource_provider.cc

Issue 177953004: Enable SurfaceTexture based zero-copy texture uploading on Android platform Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')
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 e58ed0b73b7c33c01b62ae654d8ec3bdf1664704..e1e66fafbb1a5ec6cc140bfd6fd7f89d6528336d 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -2150,10 +2150,14 @@ uint8_t* ResourceProvider::MapImage(const Resource* resource, int* stride) {
DCHECK(resource->image_id);
GLES2Interface* gl = ContextGL();
DCHECK(gl);
+ // For SurfaceTexture-backed GpuMemoryBuffer, the actual
+ // Stride can only be got after it is mapped and ANativeWindow_Buffer
+ // is locked.
reveman 2014/02/26 08:02:34 We should probably make this a general requirement
+ uint8_t* ret = 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 ret;
}
DCHECK_EQ(Bitmap, resource->type);
*stride = 0;
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698