| 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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3061 } | 3061 } |
| 3062 | 3062 |
| 3063 void TextureManager::DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd, | 3063 void TextureManager::DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd, |
| 3064 TextureRef* ref) { | 3064 TextureRef* ref) { |
| 3065 uint32_t size = ref->texture()->estimated_size(); | 3065 uint32_t size = ref->texture()->estimated_size(); |
| 3066 | 3066 |
| 3067 // Ignore unallocated texture IDs. | 3067 // Ignore unallocated texture IDs. |
| 3068 if (size == 0) | 3068 if (size == 0) |
| 3069 return; | 3069 return; |
| 3070 | 3070 |
| 3071 std::string dump_name = | 3071 std::string dump_name = base::StringPrintf( |
| 3072 base::StringPrintf("gpu/gl/textures/client_%d/texture_%d", | 3072 "gpu/gl/textures/share_group_%" PRIu64 "/texture_%d", |
| 3073 memory_tracker_->ClientId(), ref->client_id()); | 3073 memory_tracker_->ShareGroupTracingGUID(), ref->client_id()); |
| 3074 | 3074 |
| 3075 base::trace_event::MemoryAllocatorDump* dump = | 3075 base::trace_event::MemoryAllocatorDump* dump = |
| 3076 pmd->CreateAllocatorDump(dump_name); | 3076 pmd->CreateAllocatorDump(dump_name); |
| 3077 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 3077 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 3078 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 3078 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 3079 static_cast<uint64_t>(size)); | 3079 static_cast<uint64_t>(size)); |
| 3080 | 3080 |
| 3081 // Add the |client_guid| which expresses shared ownership with the client | 3081 // Add the |client_guid| which expresses shared ownership with the client |
| 3082 // process. | 3082 // process. |
| 3083 auto client_guid = gl::GetGLTextureClientGUIDForTracing( | 3083 auto client_guid = gl::GetGLTextureClientGUIDForTracing( |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3364 uint32_t TextureManager::GetServiceIdGeneration() const { | 3364 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3365 return current_service_id_generation_; | 3365 return current_service_id_generation_; |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 void TextureManager::IncrementServiceIdGeneration() { | 3368 void TextureManager::IncrementServiceIdGeneration() { |
| 3369 current_service_id_generation_++; | 3369 current_service_id_generation_++; |
| 3370 } | 3370 } |
| 3371 | 3371 |
| 3372 } // namespace gles2 | 3372 } // namespace gles2 |
| 3373 } // namespace gpu | 3373 } // namespace gpu |
| OLD | NEW |