OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/layers/heads_up_display_layer_impl.h" | 5 #include "cc/layers/heads_up_display_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 SkPaint::kLeft_Align, | 484 SkPaint::kLeft_Align, |
485 kFontHeight, | 485 kFontHeight, |
486 title_pos); | 486 title_pos); |
487 | 487 |
488 std::string text = | 488 std::string text = |
489 base::StringPrintf("%6.1f MB used", | 489 base::StringPrintf("%6.1f MB used", |
490 (memory_entry_.bytes_unreleasable + | 490 (memory_entry_.bytes_unreleasable + |
491 memory_entry_.bytes_allocated) / megabyte); | 491 memory_entry_.bytes_allocated) / megabyte); |
492 DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat1_pos); | 492 DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat1_pos); |
493 | 493 |
494 if (memory_entry_.bytes_over) { | 494 if (!memory_entry_.had_enough_memory) |
495 paint.setColor(SK_ColorRED); | 495 paint.setColor(SK_ColorRED); |
496 text = base::StringPrintf("%6.1f MB over", | 496 text = base::StringPrintf("%6.1f MB max ", |
497 memory_entry_.bytes_over / megabyte); | 497 memory_entry_.total_budget_in_bytes / megabyte); |
498 } else { | |
499 text = base::StringPrintf("%6.1f MB max ", | |
500 memory_entry_.total_budget_in_bytes / megabyte); | |
501 } | |
502 DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat2_pos); | 498 DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat2_pos); |
503 | 499 |
504 return area; | 500 return area; |
505 } | 501 } |
506 | 502 |
507 SkRect HeadsUpDisplayLayerImpl::DrawPaintTimeDisplay( | 503 SkRect HeadsUpDisplayLayerImpl::DrawPaintTimeDisplay( |
508 SkCanvas* canvas, | 504 SkCanvas* canvas, |
509 const PaintTimeCounter* paint_time_counter, | 505 const PaintTimeCounter* paint_time_counter, |
510 int right, | 506 int right, |
511 int top) const { | 507 int top) const { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { | 754 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { |
759 return "cc::HeadsUpDisplayLayerImpl"; | 755 return "cc::HeadsUpDisplayLayerImpl"; |
760 } | 756 } |
761 | 757 |
762 void HeadsUpDisplayLayerImpl::AsValueInto(base::DictionaryValue* dict) const { | 758 void HeadsUpDisplayLayerImpl::AsValueInto(base::DictionaryValue* dict) const { |
763 LayerImpl::AsValueInto(dict); | 759 LayerImpl::AsValueInto(dict); |
764 dict->SetString("layer_name", "Heads Up Display Layer"); | 760 dict->SetString("layer_name", "Heads Up Display Layer"); |
765 } | 761 } |
766 | 762 |
767 } // namespace cc | 763 } // namespace cc |
OLD | NEW |