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

Side by Side Diff: ui/gfx/gpu_memory_buffer.cc

Issue 2819803002: Reorganize GUIDs for GPU memory buffers (Closed)
Patch Set: Address on reviews Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/gfx/gpu_memory_buffer.h" 5 #include "ui/gfx/gpu_memory_buffer.h"
6 6
7 #include "ui/gfx/generic_shared_memory_id.h"
8 #include "ui/gfx/gpu_memory_buffer_tracing.h"
9
7 namespace gfx { 10 namespace gfx {
8 11
9 GpuMemoryBufferHandle::GpuMemoryBufferHandle() 12 GpuMemoryBufferHandle::GpuMemoryBufferHandle()
10 : type(EMPTY_BUFFER), id(0), handle(base::SharedMemory::NULLHandle()) { 13 : type(EMPTY_BUFFER), id(0), handle(base::SharedMemory::NULLHandle()) {
11 } 14 }
12 15
13 GpuMemoryBufferHandle::GpuMemoryBufferHandle( 16 GpuMemoryBufferHandle::GpuMemoryBufferHandle(
14 const GpuMemoryBufferHandle& other) = default; 17 const GpuMemoryBufferHandle& other) = default;
15 18
16 GpuMemoryBufferHandle::~GpuMemoryBufferHandle() {} 19 GpuMemoryBufferHandle::~GpuMemoryBufferHandle() {}
(...skipping 24 matching lines...) Expand all
41 gfx::CloneHandleForIPC(source_handle.native_pixmap_handle); 44 gfx::CloneHandleForIPC(source_handle.native_pixmap_handle);
42 #endif 45 #endif
43 return handle; 46 return handle;
44 } 47 }
45 case gfx::IO_SURFACE_BUFFER: 48 case gfx::IO_SURFACE_BUFFER:
46 return source_handle; 49 return source_handle;
47 } 50 }
48 return gfx::GpuMemoryBufferHandle(); 51 return gfx::GpuMemoryBufferHandle();
49 } 52 }
50 53
54 base::trace_event::MemoryAllocatorDumpGuid
55 GpuMemoryBufferHandle::GetGUIDForTracing(uint64_t tracing_process_id) {
56 if (type == gfx::SHARED_MEMORY_BUFFER)
reveman 2017/04/17 13:21:06 not a fan of this special case but should go away
ericrk 2017/04/17 18:10:15 This special case was added to allow all shared me
hajimehoshi 2017/04/18 08:21:58 Done. On 2017/04/17 18:10:15, ericrk wrote:
57 return gfx::GetSharedMemoryGUIDForTracing(tracing_process_id, id);
58 return gfx::GetGenericSharedGpuMemoryGUIDForTracing(tracing_process_id, id);
59 }
60
51 } // namespace gfx 61 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698