| 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 std::vector<DebugRect> new_paint_rects; | 660 std::vector<DebugRect> new_paint_rects; |
| 661 | 661 |
| 662 for (size_t i = 0; i < debug_rects.size(); ++i) { | 662 for (size_t i = 0; i < debug_rects.size(); ++i) { |
| 663 SkColor stroke_color = 0; | 663 SkColor stroke_color = 0; |
| 664 SkColor fill_color = 0; | 664 SkColor fill_color = 0; |
| 665 float stroke_width = 0.f; | 665 float stroke_width = 0.f; |
| 666 std::string label_text; | 666 std::string label_text; |
| 667 | 667 |
| 668 switch (debug_rects[i].type) { | 668 switch (debug_rects[i].type) { |
| 669 case PAINT_RECT_TYPE: | 669 case PAINT_RECT_TYPE: |
| 670 case FIRST_PAINT_RECT_TYPE: |
| 670 new_paint_rects.push_back(debug_rects[i]); | 671 new_paint_rects.push_back(debug_rects[i]); |
| 671 continue; | 672 continue; |
| 672 case PROPERTY_CHANGED_RECT_TYPE: | 673 case PROPERTY_CHANGED_RECT_TYPE: |
| 673 stroke_color = DebugColors::PropertyChangedRectBorderColor(); | 674 stroke_color = DebugColors::PropertyChangedRectBorderColor(); |
| 674 fill_color = DebugColors::PropertyChangedRectFillColor(); | 675 fill_color = DebugColors::PropertyChangedRectFillColor(); |
| 675 stroke_width = DebugColors::PropertyChangedRectBorderWidth(); | 676 stroke_width = DebugColors::PropertyChangedRectBorderWidth(); |
| 676 break; | 677 break; |
| 677 case SURFACE_DAMAGE_RECT_TYPE: | 678 case SURFACE_DAMAGE_RECT_TYPE: |
| 678 stroke_color = DebugColors::SurfaceDamageRectBorderColor(); | 679 stroke_color = DebugColors::SurfaceDamageRectBorderColor(); |
| 679 fill_color = DebugColors::SurfaceDamageRectFillColor(); | 680 fill_color = DebugColors::SurfaceDamageRectFillColor(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 label_text); | 741 label_text); |
| 741 } | 742 } |
| 742 | 743 |
| 743 if (new_paint_rects.size()) { | 744 if (new_paint_rects.size()) { |
| 744 paint_rects_.swap(new_paint_rects); | 745 paint_rects_.swap(new_paint_rects); |
| 745 fade_step_ = DebugColors::kFadeSteps; | 746 fade_step_ = DebugColors::kFadeSteps; |
| 746 } | 747 } |
| 747 if (fade_step_ > 0) { | 748 if (fade_step_ > 0) { |
| 748 fade_step_--; | 749 fade_step_--; |
| 749 for (size_t i = 0; i < paint_rects_.size(); ++i) { | 750 for (size_t i = 0; i < paint_rects_.size(); ++i) { |
| 750 DrawDebugRect(canvas, | 751 bool is_first_paint = paint_rects_[i].type == FIRST_PAINT_RECT_TYPE; |
| 751 &paint, | 752 DrawDebugRect( |
| 752 paint_rects_[i], | 753 canvas, |
| 753 DebugColors::PaintRectBorderColor(fade_step_), | 754 &paint, |
| 754 DebugColors::PaintRectFillColor(fade_step_), | 755 paint_rects_[i], |
| 755 DebugColors::PaintRectBorderWidth(), | 756 DebugColors::PaintRectBorderColor(fade_step_, is_first_paint), |
| 756 ""); | 757 DebugColors::PaintRectFillColor(fade_step_, is_first_paint), |
| 758 DebugColors::PaintRectBorderWidth(), |
| 759 ""); |
| 757 } | 760 } |
| 758 } | 761 } |
| 759 } | 762 } |
| 760 | 763 |
| 761 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { | 764 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { |
| 762 return "cc::HeadsUpDisplayLayerImpl"; | 765 return "cc::HeadsUpDisplayLayerImpl"; |
| 763 } | 766 } |
| 764 | 767 |
| 765 void HeadsUpDisplayLayerImpl::AsValueInto( | 768 void HeadsUpDisplayLayerImpl::AsValueInto( |
| 766 base::debug::TracedValue* dict) const { | 769 base::debug::TracedValue* dict) const { |
| 767 LayerImpl::AsValueInto(dict); | 770 LayerImpl::AsValueInto(dict); |
| 768 dict->SetString("layer_name", "Heads Up Display Layer"); | 771 dict->SetString("layer_name", "Heads Up Display Layer"); |
| 769 } | 772 } |
| 770 | 773 |
| 771 } // namespace cc | 774 } // namespace cc |
| OLD | NEW |