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

Unified Diff: cc/layers/heads_up_display_layer_impl.cc

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 2 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 | « cc/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/heads_up_display_layer_impl.cc
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 85bb2f1037f414d7ae4b10f3d5dd7ab1d44ec2e7..a1c9443711df58343c943da7636f0dcb0e1d035d 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -485,7 +485,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
int right,
int top,
int width) const {
- if (!memory_entry_.bytes_total())
+ if (!memory_entry_.total_bytes_used)
return SkRect::MakeEmpty();
const int kPadding = 4;
@@ -495,7 +495,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
const int left = bounds().width() - width - right;
const SkRect area = SkRect::MakeXYWH(left, top, width, height);
- const double megabyte = 1024.0 * 1024.0;
+ const double kMegabyte = 1024.0 * 1024.0;
SkPaint paint = CreatePaint();
DrawGraphBackground(canvas, &paint, area);
@@ -514,20 +514,14 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
kFontHeight,
title_pos);
- std::string text =
- base::StringPrintf("%6.1f MB used",
- (memory_entry_.bytes_unreleasable +
- memory_entry_.bytes_allocated) / megabyte);
+ std::string text = base::StringPrintf(
+ "%6.1f MB used", memory_entry_.total_bytes_used / kMegabyte);
DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat1_pos);
- if (memory_entry_.bytes_over) {
+ if (!memory_entry_.had_enough_memory)
paint.setColor(SK_ColorRED);
- text = base::StringPrintf("%6.1f MB over",
- memory_entry_.bytes_over / megabyte);
- } else {
- text = base::StringPrintf("%6.1f MB max ",
- memory_entry_.total_budget_in_bytes / megabyte);
- }
+ text = base::StringPrintf("%6.1f MB max ",
+ memory_entry_.total_budget_in_bytes / kMegabyte);
DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat2_pos);
return area;
« no previous file with comments | « cc/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698