| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/raster/one_copy_tile_task_worker_pool.h" | 5 #include "cc/raster/one_copy_tile_task_worker_pool.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <limits> | 10 #include <limits> |
| 9 #include <utility> | 11 #include <utility> |
| 10 | 12 |
| 13 #include "base/macros.h" |
| 11 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 12 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
| 13 #include "base/trace_event/memory_dump_manager.h" | 16 #include "base/trace_event/memory_dump_manager.h" |
| 14 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 15 #include "base/trace_event/trace_event_argument.h" | 18 #include "base/trace_event/trace_event_argument.h" |
| 16 #include "cc/base/container_util.h" | 19 #include "cc/base/container_util.h" |
| 17 #include "cc/base/math_util.h" | 20 #include "cc/base/math_util.h" |
| 18 #include "cc/debug/traced_value.h" | 21 #include "cc/debug/traced_value.h" |
| 19 #include "cc/raster/raster_buffer.h" | 22 #include "cc/raster/raster_buffer.h" |
| 20 #include "cc/resources/platform_color.h" | 23 #include "cc/resources/platform_color.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 uint64_t buffer_size_in_bytes = | 156 uint64_t buffer_size_in_bytes = |
| 154 ResourceUtil::UncheckedSizeInBytes<uint64_t>(size, format); | 157 ResourceUtil::UncheckedSizeInBytes<uint64_t>(size, format); |
| 155 buffer_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 158 buffer_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 156 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 159 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 157 buffer_size_in_bytes); | 160 buffer_size_in_bytes); |
| 158 buffer_dump->AddScalar("free_size", | 161 buffer_dump->AddScalar("free_size", |
| 159 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 162 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 160 in_free_list ? buffer_size_in_bytes : 0); | 163 in_free_list ? buffer_size_in_bytes : 0); |
| 161 | 164 |
| 162 // Emit an ownership edge towards a global allocator dump node. | 165 // Emit an ownership edge towards a global allocator dump node. |
| 163 const uint64 tracing_process_id = | 166 const uint64_t tracing_process_id = |
| 164 base::trace_event::MemoryDumpManager::GetInstance() | 167 base::trace_event::MemoryDumpManager::GetInstance() |
| 165 ->GetTracingProcessId(); | 168 ->GetTracingProcessId(); |
| 166 base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid = | 169 base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid = |
| 167 gfx::GetGpuMemoryBufferGUIDForTracing(tracing_process_id, buffer_id); | 170 gfx::GetGpuMemoryBufferGUIDForTracing(tracing_process_id, buffer_id); |
| 168 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); | 171 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); |
| 169 | 172 |
| 170 // By creating an edge with a higher |importance| (w.r.t. browser-side dumps) | 173 // By creating an edge with a higher |importance| (w.r.t. browser-side dumps) |
| 171 // the tracing UI will account the effective size of the buffer to the child. | 174 // the tracing UI will account the effective size of the buffer to the child. |
| 172 const int kImportance = 2; | 175 const int kImportance = 2; |
| 173 pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance); | 176 pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance); |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 return; | 723 return; |
| 721 | 724 |
| 722 busy_buffers_.front()->DestroyGLResources(gl); | 725 busy_buffers_.front()->DestroyGLResources(gl); |
| 723 RemoveStagingBuffer(busy_buffers_.front().get()); | 726 RemoveStagingBuffer(busy_buffers_.front().get()); |
| 724 busy_buffers_.pop_front(); | 727 busy_buffers_.pop_front(); |
| 725 } | 728 } |
| 726 } | 729 } |
| 727 } | 730 } |
| 728 | 731 |
| 729 } // namespace cc | 732 } // namespace cc |
| OLD | NEW |