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, |
| 447 uint64_t process_tracing_id, |
| 448 const std::string& dump_name) { |
| 449 // Log size 0 if |ref_counted_memory_| has been released. |
| 450 size_t size_in_bytes = memory_ ? SizeInBytes(size_, format_) : 0; |
| 451 |
| 452 base::trace_event::MemoryAllocatorDump* dump = |
| 453 pmd->CreateAllocatorDump(dump_name); |
| 454 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 455 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 456 static_cast<uint64_t>(size_in_bytes)); |
| 457 } |
| 458 |
446 } // namespace gfx | 459 } // namespace gfx |
OLD | NEW |