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

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: 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
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..c3c625e883b8703f50abec848c184a70aee5885f 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,
+ MemoryTracker* memory_tracker,
+ const std::string& dump_name) const {
ericrk 2015/08/18 07:39:52 David, I remember you mentioning that we never had
ericrk 2015/08/18 09:00:47 Per offline discussion, not changing this.
+ 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) {
+ level_infos[level_index].image->OnMemoryDump(
+ pmd, memory_tracker->ClientTracingId(),
+ 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,12 @@ 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());
+
+ if (ref->texture()->HasImages()) {
reveman 2015/08/18 08:32:52 refactor this as discussed
ericrk 2015/08/18 09:00:47 Done.
+ ref->texture()->DumpImageMemory(pmd, memory_tracker_, dump_name);
+ return;
+ }
+
base::trace_event::MemoryAllocatorDump* dump =
pmd->CreateAllocatorDump(dump_name);
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,

Powered by Google App Engine
This is Rietveld 408576698