| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_tracing.h" | 5 #include "ui/gfx/gpu_memory_buffer_tracing.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" |
| 8 #include "base/strings/stringprintf.h" |
| 9 |
| 7 namespace gfx { | 10 namespace gfx { |
| 8 | 11 |
| 9 base::trace_event::MemoryAllocatorDumpGuid GetGpuMemoryBufferGUIDForTracing( | 12 base::trace_event::MemoryAllocatorDumpGuid GetSharedMemoryGUIDForTracing( |
| 10 uint64_t tracing_process_id, | 13 uint64_t tracing_process_id, |
| 11 GpuMemoryBufferId buffer_id) { | 14 GpuMemoryBufferId buffer_id) { |
| 12 // TODO(ericrk): Currently this function just wraps | 15 // TODO(hajimehoshi): This should be unified to shared memory GUIDs in |
| 13 // GetGenericSharedMemoryGUIDForTracing, we may want to special case this if | 16 // base/memory/shared_memory_tracker.cc |
| 14 // the GPU memory buffer is not backed by shared memory. | 17 return base::trace_event::MemoryAllocatorDumpGuid(base::StringPrintf( |
| 15 return gfx::GetGenericSharedMemoryGUIDForTracing(tracing_process_id, | 18 "shared_memory_gpu/%" PRIx64 "/%d", tracing_process_id, buffer_id.id)); |
| 16 buffer_id); | |
| 17 } | 19 } |
| 18 | 20 |
| 19 } // namespace gfx | 21 } // namespace gfx |
| OLD | NEW |