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

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

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include x11 pixmap tracker Created 6 years, 6 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 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);
}
}

Powered by Google App Engine
This is Rietveld 408576698