| 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 3795fa7acf1e09a2c7472093ce1e3d2967cee6c1..029624512869f1b2bad57c4a63ba78cb7059e9fe 100644
|
| --- a/content/common/gpu/gpu_command_buffer_stub.cc
|
| +++ b/content/common/gpu/gpu_command_buffer_stub.cc
|
| @@ -928,23 +928,37 @@ void GpuCommandBufferStub::OnSetClientHasMemoryAllocationChangedCallback(
|
|
|
| void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer(
|
| int32 id,
|
| - gfx::GpuMemoryBufferHandle gpu_memory_buffer,
|
| + gfx::GpuMemoryBufferHandle handle,
|
| uint32 width,
|
| uint32 height,
|
| uint32 internalformat) {
|
| TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterGpuMemoryBuffer");
|
| +
|
| + // Verify that renderer is not trying to use a buffer it doesn't own.
|
| + switch (handle.type) {
|
| #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()->client_id()) {
|
| - LOG(ERROR) << "Illegal surface texture ID for renderer.";
|
| - return;
|
| - }
|
| + case gfx::SURFACE_TEXTURE_BUFFER:
|
| + if (handle.surface_texture_id.secondary_id != channel()->client_id()) {
|
| + LOG(ERROR) << "Illegal surface texture ID for renderer.";
|
| + return;
|
| + }
|
| + break;
|
| #endif
|
| +#if defined(USE_X11)
|
| + case gfx::X11_PIXMAP_BUFFER:
|
| + if (handle.global_id.secondary_id != channel()->client_id()) {
|
| + LOG(ERROR) << "Illegal global ID for renderer.";
|
| + return;
|
| + }
|
| + break;
|
| +#endif
|
| + default:
|
| + break;
|
| + }
|
| +
|
| if (gpu_control_service_) {
|
| gpu_control_service_->RegisterGpuMemoryBuffer(
|
| - id, gpu_memory_buffer, width, height, internalformat);
|
| + id, handle, width, height, internalformat);
|
| }
|
| }
|
|
|
|
|