Index: gpu/command_buffer/client/gles2_implementation.cc |
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc |
index e85929912f6af462e57c7e0ddbda2ee017f606fc..27779c958d51d34812da718c167e81bf3a24dcb6 100644 |
--- a/gpu/command_buffer/client/gles2_implementation.cc |
+++ b/gpu/command_buffer/client/gles2_implementation.cc |
@@ -2203,6 +2203,22 @@ void GLES2Implementation::TexImage2D( |
return; |
} |
+ // Check if we can allocate shared memory to send it. |
+ int32 mapped_shm_id = 0; |
+ unsigned int mapped_shm_offset = 0; |
+ void* mem = mapped_memory_->Alloc(size, &mapped_shm_id, &mapped_shm_offset); |
+ if (mem) { |
+ CopyRectToBuffer( |
+ pixels, height, unpadded_row_size, src_padded_row_size, unpack_flip_y_, |
+ mem, padded_row_size); |
+ helper_->TexImage2D( |
+ target, level, internalformat, width, height, format, type, |
+ mapped_shm_id, mapped_shm_offset); |
+ CheckGLError(); |
+ mapped_memory_->FreePendingToken(mem, helper_->InsertToken()); |
piman
2015/06/08 21:12:35
Can you force a shallow flush here? Without it, th
David Yen
2015/06/08 21:34:06
Done. Although in order to do this in my new versi
|
+ return; |
+ } |
+ |
// No, so send it using TexSubImage2D. |
helper_->TexImage2D( |
target, level, internalformat, width, height, format, type, |