| OLD | NEW |
| 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 "gpu/command_buffer/service/buffer_manager.h" | 5 #include "gpu/command_buffer/service/buffer_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 break; | 631 break; |
| 632 } | 632 } |
| 633 if (primitive_restart_fixed_index_ != index) { | 633 if (primitive_restart_fixed_index_ != index) { |
| 634 glPrimitiveRestartIndex(index); | 634 glPrimitiveRestartIndex(index); |
| 635 primitive_restart_fixed_index_ = index; | 635 primitive_restart_fixed_index_ = index; |
| 636 } | 636 } |
| 637 } | 637 } |
| 638 | 638 |
| 639 bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 639 bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 640 base::trace_event::ProcessMemoryDump* pmd) { | 640 base::trace_event::ProcessMemoryDump* pmd) { |
| 641 const int client_id = memory_tracker_->ClientId(); | 641 const uint64_t share_group_tracing_guid = |
| 642 memory_tracker_->ShareGroupTracingGUID(); |
| 642 for (const auto& buffer_entry : buffers_) { | 643 for (const auto& buffer_entry : buffers_) { |
| 643 const auto& client_buffer_id = buffer_entry.first; | 644 const auto& client_buffer_id = buffer_entry.first; |
| 644 const auto& buffer = buffer_entry.second; | 645 const auto& buffer = buffer_entry.second; |
| 645 | 646 |
| 646 std::string dump_name = base::StringPrintf( | 647 std::string dump_name = |
| 647 "gpu/gl/buffers/client_%d/buffer_%d", client_id, client_buffer_id); | 648 base::StringPrintf("gpu/gl/buffers/share_group_%" PRIu64 "/buffer_%d", |
| 649 share_group_tracing_guid, client_buffer_id); |
| 648 base::trace_event::MemoryAllocatorDump* dump = | 650 base::trace_event::MemoryAllocatorDump* dump = |
| 649 pmd->CreateAllocatorDump(dump_name); | 651 pmd->CreateAllocatorDump(dump_name); |
| 650 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 652 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 651 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 653 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 652 static_cast<uint64_t>(buffer->size())); | 654 static_cast<uint64_t>(buffer->size())); |
| 653 | 655 |
| 654 auto guid = gl::GetGLBufferGUIDForTracing( | 656 auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid, |
| 655 memory_tracker_->ShareGroupTracingGUID(), client_buffer_id); | 657 client_buffer_id); |
| 656 pmd->CreateSharedGlobalAllocatorDump(guid); | 658 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 657 pmd->AddOwnershipEdge(dump->guid(), guid); | 659 pmd->AddOwnershipEdge(dump->guid(), guid); |
| 658 } | 660 } |
| 659 return true; | 661 return true; |
| 660 } | 662 } |
| 661 | 663 |
| 662 } // namespace gles2 | 664 } // namespace gles2 |
| 663 } // namespace gpu | 665 } // namespace gpu |
| OLD | NEW |