Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Unified Diff: gpu/command_buffer/service/texture_manager.cc

Issue 1299713003: GLImage::OnMemoryDump Stubs + Some Impls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@images1.3
Patch Set: review feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | ui/gfx/generic_shared_memory_id.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | ui/gfx/generic_shared_memory_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698