| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 paint->setColor(DebugColors::HUDIndicatorLineColor()); | 333 paint->setColor(DebugColors::HUDIndicatorLineColor()); |
| 334 paint->setXfermodeMode(SkXfermode::kPlus_Mode); | 334 paint->setXfermodeMode(SkXfermode::kPlus_Mode); |
| 335 const double indicator_top = | 335 const double indicator_top = |
| 336 bounds.height() * (1.0 - graph.indicator / graph.current_upper_bound) - | 336 bounds.height() * (1.0 - graph.indicator / graph.current_upper_bound) - |
| 337 1.0; | 337 1.0; |
| 338 canvas->drawLine(bounds.left(), | 338 canvas->drawLine(bounds.left(), |
| 339 bounds.top() + indicator_top, | 339 bounds.top() + indicator_top, |
| 340 bounds.right(), | 340 bounds.right(), |
| 341 bounds.top() + indicator_top, | 341 bounds.top() + indicator_top, |
| 342 *paint); | 342 *paint); |
| 343 paint->setXfermode(NULL); | 343 paint->setXfermode(nullptr); |
| 344 } | 344 } |
| 345 | 345 |
| 346 SkRect HeadsUpDisplayLayerImpl::DrawFPSDisplay( | 346 SkRect HeadsUpDisplayLayerImpl::DrawFPSDisplay( |
| 347 SkCanvas* canvas, | 347 SkCanvas* canvas, |
| 348 const FrameRateCounter* fps_counter, | 348 const FrameRateCounter* fps_counter, |
| 349 int right, | 349 int right, |
| 350 int top) const { | 350 int top) const { |
| 351 const int kPadding = 4; | 351 const int kPadding = 4; |
| 352 const int kGap = 6; | 352 const int kGap = 6; |
| 353 | 353 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return "cc::HeadsUpDisplayLayerImpl"; | 782 return "cc::HeadsUpDisplayLayerImpl"; |
| 783 } | 783 } |
| 784 | 784 |
| 785 void HeadsUpDisplayLayerImpl::AsValueInto( | 785 void HeadsUpDisplayLayerImpl::AsValueInto( |
| 786 base::debug::TracedValue* dict) const { | 786 base::debug::TracedValue* dict) const { |
| 787 LayerImpl::AsValueInto(dict); | 787 LayerImpl::AsValueInto(dict); |
| 788 dict->SetString("layer_name", "Heads Up Display Layer"); | 788 dict->SetString("layer_name", "Heads Up Display Layer"); |
| 789 } | 789 } |
| 790 | 790 |
| 791 } // namespace cc | 791 } // namespace cc |
| OLD | NEW |