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

Side by Side Diff: ui/gl/gl_image_memory.cc

Issue 1299713003: GLImage::OnMemoryDump Stubs + Some Impls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@images1.3
Patch Set: Fix android build. 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_image_memory.h ('k') | ui/gl/gl_image_ozone_native_pixmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_image_memory.h ('k') | ui/gl/gl_image_ozone_native_pixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698