Chromium Code Reviews| Index: gpu/command_buffer/service/texture_manager.cc |
| diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc |
| index ed0fd10e5b1e6e1ae96fc5b0316d0be8b10290fb..045ed791627bda0dbde5f3b8081b45c1c2e7d2da 100644 |
| --- a/gpu/command_buffer/service/texture_manager.cc |
| +++ b/gpu/command_buffer/service/texture_manager.cc |
| @@ -1294,6 +1294,23 @@ void Texture::OnDidModifyPixels() { |
| image->DidModifyTexImage(); |
| } |
| +void Texture::DumpImageMemory(base::trace_event::ProcessMemoryDump* pmd, |
| + uint64_t client_tracing_id, |
| + const std::string& dump_name) const { |
| + for (uint32_t face_index = 0; face_index < face_infos_.size(); ++face_index) { |
| + const auto& level_infos = face_infos_[face_index].level_infos; |
| + for (uint32_t level_index = 0; level_index < level_infos.size(); |
| + ++level_index) { |
| + if (level_infos[level_index].image) { |
|
reveman
2015/08/18 09:05:57
should we dump the memory used by each level in th
ericrk
2015/08/18 10:03:52
Dumping these, unless they are size 0. Images appe
|
| + level_infos[level_index].image->OnMemoryDump( |
| + pmd, client_tracing_id, |
| + base::StringPrintf("%s/face_%d/level_%d", dump_name.c_str(), |
| + face_index, level_index)); |
| + } |
| + } |
| + } |
| +} |
| + |
| TextureRef::TextureRef(TextureManager* manager, |
| GLuint client_id, |
| Texture* texture) |
| @@ -2061,10 +2078,6 @@ bool TextureManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| void TextureManager::DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd, |
| TextureRef* ref) { |
| - // TODO(ericrk): Trace image-backed textures. crbug.com/514914 |
| - if (ref->texture()->HasImages()) |
| - return; |
| - |
| uint32_t size = ref->texture()->estimated_size(); |
| // Ignore unallocated texture IDs. |
| @@ -2074,6 +2087,7 @@ void TextureManager::DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd, |
| std::string dump_name = |
| base::StringPrintf("gl/textures/client_%d/texture_%d", |
| memory_tracker_->ClientId(), ref->client_id()); |
| + |
| base::trace_event::MemoryAllocatorDump* dump = |
| pmd->CreateAllocatorDump(dump_name); |
| dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| @@ -2102,6 +2116,13 @@ void TextureManager::DumpTextureRef(base::trace_event::ProcessMemoryDump* pmd, |
| importance = 2; |
| pmd->AddOwnershipEdge(client_guid, service_guid, importance); |
| + |
| + // If a texture has images, dump them now. They will appear below the main |
| + // gl/textures/client_X/texture_Y dump. |
| + if (ref->texture()->HasImages()) { |
|
reveman
2015/08/18 09:05:57
is this "if" statement needed?
ericrk
2015/08/18 10:03:52
I guess not. Especially now that we are dumping mo
|
| + ref->texture()->DumpImageMemory(pmd, memory_tracker_->ClientTracingId(), |
| + dump_name); |
| + } |
| } |
| } // namespace gles2 |