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

Side by Side Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 685983005: gpu: Associate all GpuMemoryBuffers with unique IDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and address feedback Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/client/gpu_channel_host.h" 5 #include "content/common/gpu/client/gpu_channel_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 return base::FileDescriptor(duped_handle, true); 275 return base::FileDescriptor(duped_handle, true);
276 #endif 276 #endif
277 } 277 }
278 278
279 int32 GpuChannelHost::ReserveTransferBufferId() { 279 int32 GpuChannelHost::ReserveTransferBufferId() {
280 return next_transfer_buffer_id_.GetNext(); 280 return next_transfer_buffer_id_.GetNext();
281 } 281 }
282 282
283 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( 283 gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess(
284 gfx::GpuMemoryBufferHandle source_handle, 284 const gfx::GpuMemoryBufferHandle& source_handle,
285 bool* requires_sync_point) { 285 bool* requires_sync_point) {
286 switch (source_handle.type) { 286 switch (source_handle.type) {
287 case gfx::SHARED_MEMORY_BUFFER: { 287 case gfx::SHARED_MEMORY_BUFFER: {
288 gfx::GpuMemoryBufferHandle handle; 288 gfx::GpuMemoryBufferHandle handle;
289 handle.type = gfx::SHARED_MEMORY_BUFFER; 289 handle.type = gfx::SHARED_MEMORY_BUFFER;
290 handle.handle = ShareToGpuProcess(source_handle.handle); 290 handle.handle = ShareToGpuProcess(source_handle.handle);
291 *requires_sync_point = false; 291 *requires_sync_point = false;
292 return handle; 292 return handle;
293 } 293 }
294 #if defined(USE_OZONE) 294 case gfx::IO_SURFACE_BUFFER:
reveman 2014/11/04 06:20:46 Note: I removed all these ifdefs as they are not n
295 case gfx::SURFACE_TEXTURE_BUFFER:
295 case gfx::OZONE_NATIVE_BUFFER: 296 case gfx::OZONE_NATIVE_BUFFER:
296 *requires_sync_point = true; 297 *requires_sync_point = true;
297 return source_handle; 298 return source_handle;
298 #endif
299 #if defined(OS_MACOSX)
300 case gfx::IO_SURFACE_BUFFER:
301 *requires_sync_point = true;
302 return source_handle;
303 #endif
304 #if defined(OS_ANDROID)
305 case gfx::SURFACE_TEXTURE_BUFFER:
306 *requires_sync_point = true;
307 return source_handle;
308 #endif
309 #if defined(USE_X11)
310 case gfx::X11_PIXMAP_BUFFER:
311 *requires_sync_point = true;
312 return source_handle;
313 #endif
314 default: 299 default:
315 NOTREACHED(); 300 NOTREACHED();
316 return gfx::GpuMemoryBufferHandle(); 301 return gfx::GpuMemoryBufferHandle();
317 } 302 }
318 } 303 }
319 304
320 int32 GpuChannelHost::ReserveImageId() { 305 int32 GpuChannelHost::ReserveImageId() {
321 return next_image_id_.GetNext(); 306 return next_image_id_.GetNext();
322 } 307 }
323 308
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 382
398 listeners_.clear(); 383 listeners_.clear();
399 } 384 }
400 385
401 bool GpuChannelHost::MessageFilter::IsLost() const { 386 bool GpuChannelHost::MessageFilter::IsLost() const {
402 AutoLock lock(lock_); 387 AutoLock lock(lock_);
403 return lost_; 388 return lost_;
404 } 389 }
405 390
406 } // namespace content 391 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698