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

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

Issue 2819803002: Reorganize GUIDs for GPU memory buffers (Closed)
Patch Set: Move GetGUIDForTracing from handle to GpuMemoryBuffer 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
7 namespace gfx { 9 namespace gfx {
8 10
9 GpuMemoryBufferHandle::GpuMemoryBufferHandle() 11 GpuMemoryBufferHandle::GpuMemoryBufferHandle()
10 : type(EMPTY_BUFFER), id(0), handle(base::SharedMemory::NULLHandle()) { 12 : type(EMPTY_BUFFER), id(0), handle(base::SharedMemory::NULLHandle()) {
11 } 13 }
12 14
13 GpuMemoryBufferHandle::GpuMemoryBufferHandle( 15 GpuMemoryBufferHandle::GpuMemoryBufferHandle(
14 const GpuMemoryBufferHandle& other) = default; 16 const GpuMemoryBufferHandle& other) = default;
15 17
16 GpuMemoryBufferHandle::~GpuMemoryBufferHandle() {} 18 GpuMemoryBufferHandle::~GpuMemoryBufferHandle() {}
(...skipping 24 matching lines...) Expand all
41 gfx::CloneHandleForIPC(source_handle.native_pixmap_handle); 43 gfx::CloneHandleForIPC(source_handle.native_pixmap_handle);
42 #endif 44 #endif
43 return handle; 45 return handle;
44 } 46 }
45 case gfx::IO_SURFACE_BUFFER: 47 case gfx::IO_SURFACE_BUFFER:
46 return source_handle; 48 return source_handle;
47 } 49 }
48 return gfx::GpuMemoryBufferHandle(); 50 return gfx::GpuMemoryBufferHandle();
49 } 51 }
50 52
53 base::trace_event::MemoryAllocatorDumpGuid GpuMemoryBuffer::GetGUIDForTracing(
54 uint64_t tracing_process_id) const {
55 auto handle = GetHandle();
reveman 2017/04/18 13:44:52 nit: please use GetId() instead. The handle is mea
hajimehoshi 2017/04/19 06:15:12 Done.
56 return gfx::GetGenericSharedGpuMemoryGUIDForTracing(tracing_process_id,
57 handle.id);
58 }
59
51 } // namespace gfx 60 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698