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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 195583003: Add initial GpuMemoryBufferSurfaceTexture implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::ProcessHandle explicitly in a few places Created 6 years, 9 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
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 497858a38784b8559f4d27649b5762f795548cf3..c436fa74429a441b132a5f12ab7430809a2cd52a 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -870,6 +870,15 @@ void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer(
uint32 height,
uint32 internalformat) {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterGpuMemoryBuffer");
+#if defined(OS_ANDROID)
+ // Verify that renderer is not trying to use a surface texture it doesn't own.
+ if (gpu_memory_buffer.type == gfx::SURFACE_TEXTURE_BUFFER &&
+ gpu_memory_buffer.surface_texture_id.secondary_id !=
+ channel()->renderer_pid()) {
piman 2014/03/27 01:07:25 nit: rather than the PID, use the channel's client
reveman 2014/03/27 14:48:11 Oh, I didn't know that we shared this id the GPU s
+ LOG(ERROR) << "Illegal surface texture ID for renderer.";
+ return;
+ }
+#endif
if (gpu_control_) {
gpu_control_->RegisterGpuMemoryBuffer(id,
gpu_memory_buffer,

Powered by Google App Engine
This is Rietveld 408576698