OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/gl/gl_image_memory.h" | 5 #include "ui/gl/gl_image_memory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
10 #include "ui/gl/scoped_binders.h" | 10 #include "ui/gl/scoped_binders.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
436 TextureFormat(format_), | 436 TextureFormat(format_), |
437 size_.width(), | 437 size_.width(), |
438 size_.height(), | 438 size_.height(), |
439 0, // border | 439 0, // border |
440 DataFormat(format_), | 440 DataFormat(format_), |
441 DataType(format_), | 441 DataType(format_), |
442 memory_); | 442 memory_); |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 void GLImageMemory::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 446 void GLImageMemory::DumpGLTexture(base::trace_event::ProcessMemoryDump* pmd, |
447 uint64_t process_tracing_id, | 447 const std::string& dump_name) { |
448 const std::string& dump_name) { | 448 size_t size_in_bytes = egl_texture_id_ ? SizeInBytes(size_, format_) : 0; |
reveman
2015/08/28 18:18:43
This is not enough. The gl(Compressed)TexImage2D c
ericrk
2015/08/31 17:19:32
Re worked this to track the bound texture_id_ and
| |
449 // Log size 0 if |ref_counted_memory_| has been released. | |
450 size_t size_in_bytes = memory_ ? SizeInBytes(size_, format_) : 0; | |
451 | 449 |
452 base::trace_event::MemoryAllocatorDump* dump = | 450 base::trace_event::MemoryAllocatorDump* dump = |
453 pmd->CreateAllocatorDump(dump_name); | 451 pmd->CreateAllocatorDump(dump_name + "/gl_texture"); |
reveman
2015/08/28 18:18:43
nit: s/gl_texture/texture_memory/ as I think that'
ericrk
2015/08/31 17:19:32
sgtm
| |
454 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 452 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
455 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 453 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
456 static_cast<uint64_t>(size_in_bytes)); | 454 static_cast<uint64_t>(size_in_bytes)); |
455 | |
456 // No need for a global shared edge here. This object in the GPU process is | |
457 // the sole owner of this texture id. | |
457 } | 458 } |
458 | 459 |
459 } // namespace gfx | 460 } // namespace gfx |
OLD | NEW |