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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 SkRect histogram_bounds = SkRect::MakeXYWH(graph_bounds.right() + kGap, | 378 SkRect histogram_bounds = SkRect::MakeXYWH(graph_bounds.right() + kGap, |
379 graph_bounds.top(), | 379 graph_bounds.top(), |
380 kHistogramWidth, | 380 kHistogramWidth, |
381 kGraphHeight); | 381 kGraphHeight); |
382 | 382 |
383 const std::string value_text = | 383 const std::string value_text = |
384 base::StringPrintf("FPS:%5.1f", fps_graph_.value); | 384 base::StringPrintf("FPS:%5.1f", fps_graph_.value); |
385 const std::string min_max_text = | 385 const std::string min_max_text = |
386 base::StringPrintf("%.0f-%.0f", fps_graph_.min, fps_graph_.max); | 386 base::StringPrintf("%.0f-%.0f", fps_graph_.min, fps_graph_.max); |
387 | 387 |
| 388 VLOG(1) << value_text; |
| 389 |
388 paint.setColor(DebugColors::FPSDisplayTextAndGraphColor()); | 390 paint.setColor(DebugColors::FPSDisplayTextAndGraphColor()); |
389 DrawText(canvas, | 391 DrawText(canvas, |
390 &paint, | 392 &paint, |
391 value_text, | 393 value_text, |
392 SkPaint::kLeft_Align, | 394 SkPaint::kLeft_Align, |
393 kFontHeight, | 395 kFontHeight, |
394 text_bounds.left(), | 396 text_bounds.left(), |
395 text_bounds.bottom()); | 397 text_bounds.bottom()); |
396 DrawText(canvas, | 398 DrawText(canvas, |
397 &paint, | 399 &paint, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 text_bounds2.bottom() + 2 * kPadding, | 560 text_bounds2.bottom() + 2 * kPadding, |
559 kGraphWidth, | 561 kGraphWidth, |
560 kGraphHeight); | 562 kGraphHeight); |
561 | 563 |
562 const std::string value_text = | 564 const std::string value_text = |
563 base::StringPrintf("%.1f", paint_time_graph_.value); | 565 base::StringPrintf("%.1f", paint_time_graph_.value); |
564 const std::string min_max_text = base::StringPrintf( | 566 const std::string min_max_text = base::StringPrintf( |
565 "%.1f-%.1f", paint_time_graph_.min, paint_time_graph_.max); | 567 "%.1f-%.1f", paint_time_graph_.min, paint_time_graph_.max); |
566 | 568 |
567 paint.setColor(DebugColors::PaintTimeDisplayTextAndGraphColor()); | 569 paint.setColor(DebugColors::PaintTimeDisplayTextAndGraphColor()); |
568 DrawText(canvas, | 570 DrawText(canvas, &paint, "Compositor frame time (ms)", SkPaint::kLeft_Align, |
569 &paint, | 571 kFontHeight, text_bounds.left(), text_bounds.bottom()); |
570 "Page paint time (ms)", | |
571 SkPaint::kLeft_Align, | |
572 kFontHeight, | |
573 text_bounds.left(), | |
574 text_bounds.bottom()); | |
575 DrawText(canvas, | 572 DrawText(canvas, |
576 &paint, | 573 &paint, |
577 value_text, | 574 value_text, |
578 SkPaint::kLeft_Align, | 575 SkPaint::kLeft_Align, |
579 kFontHeight, | 576 kFontHeight, |
580 text_bounds2.left(), | 577 text_bounds2.left(), |
581 text_bounds2.bottom()); | 578 text_bounds2.bottom()); |
582 DrawText(canvas, | 579 DrawText(canvas, |
583 &paint, | 580 &paint, |
584 min_max_text, | 581 min_max_text, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 return "cc::HeadsUpDisplayLayerImpl"; | 779 return "cc::HeadsUpDisplayLayerImpl"; |
783 } | 780 } |
784 | 781 |
785 void HeadsUpDisplayLayerImpl::AsValueInto( | 782 void HeadsUpDisplayLayerImpl::AsValueInto( |
786 base::debug::TracedValue* dict) const { | 783 base::debug::TracedValue* dict) const { |
787 LayerImpl::AsValueInto(dict); | 784 LayerImpl::AsValueInto(dict); |
788 dict->SetString("layer_name", "Heads Up Display Layer"); | 785 dict->SetString("layer_name", "Heads Up Display Layer"); |
789 } | 786 } |
790 | 787 |
791 } // namespace cc | 788 } // namespace cc |
OLD | NEW |