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

Side by Side Diff: cc/layers/heads_up_display_layer_impl.cc

Issue 121223002: DevTools: Change paint rectangles' colors in compositor to shades of green. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored cycling logic. Created 6 years, 10 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 unified diff | Download patch
« cc/debug/debug_colors.cc ('K') | « cc/debug/debug_colors.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 DrawGraphLines(canvas, &paint, graph_bounds, paint_time_graph_); 584 DrawGraphLines(canvas, &paint, graph_bounds, paint_time_graph_);
585 585
586 return area; 586 return area;
587 } 587 }
588 588
589 void HeadsUpDisplayLayerImpl::DrawDebugRects( 589 void HeadsUpDisplayLayerImpl::DrawDebugRects(
590 SkCanvas* canvas, 590 SkCanvas* canvas,
591 DebugRectHistory* debug_rect_history) const { 591 DebugRectHistory* debug_rect_history) const {
592 const std::vector<DebugRect>& debug_rects = debug_rect_history->debug_rects(); 592 const std::vector<DebugRect>& debug_rects = debug_rect_history->debug_rects();
593 SkPaint paint = CreatePaint(); 593 SkPaint paint = CreatePaint();
594 static int s_currentPaintRectColor = 0;
danakj 2014/01/30 20:20:38 any reason why this is a static variable instead o
595 s_currentPaintRectColor++;
594 596
595 for (size_t i = 0; i < debug_rects.size(); ++i) { 597 for (size_t i = 0; i < debug_rects.size(); ++i) {
596 SkColor stroke_color = 0; 598 SkColor stroke_color = 0;
597 SkColor fill_color = 0; 599 SkColor fill_color = 0;
598 float stroke_width = 0.f; 600 float stroke_width = 0.f;
599 std::string label_text; 601 std::string label_text;
600 602
601 switch (debug_rects[i].type) { 603 switch (debug_rects[i].type) {
602 case PAINT_RECT_TYPE: 604 case PAINT_RECT_TYPE:
603 stroke_color = DebugColors::PaintRectBorderColor(); 605 stroke_color =
604 fill_color = DebugColors::PaintRectFillColor(); 606 DebugColors::PaintRectBorderColor(s_currentPaintRectColor);
607 fill_color = DebugColors::PaintRectFillColor(s_currentPaintRectColor);
605 stroke_width = DebugColors::PaintRectBorderWidth(); 608 stroke_width = DebugColors::PaintRectBorderWidth();
606 break; 609 break;
607 case PROPERTY_CHANGED_RECT_TYPE: 610 case PROPERTY_CHANGED_RECT_TYPE:
608 stroke_color = DebugColors::PropertyChangedRectBorderColor(); 611 stroke_color = DebugColors::PropertyChangedRectBorderColor();
609 fill_color = DebugColors::PropertyChangedRectFillColor(); 612 fill_color = DebugColors::PropertyChangedRectFillColor();
610 stroke_width = DebugColors::PropertyChangedRectBorderWidth(); 613 stroke_width = DebugColors::PropertyChangedRectBorderWidth();
611 break; 614 break;
612 case SURFACE_DAMAGE_RECT_TYPE: 615 case SURFACE_DAMAGE_RECT_TYPE:
613 stroke_color = DebugColors::SurfaceDamageRectBorderColor(); 616 stroke_color = DebugColors::SurfaceDamageRectBorderColor();
614 fill_color = DebugColors::SurfaceDamageRectFillColor(); 617 fill_color = DebugColors::SurfaceDamageRectFillColor();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { 711 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const {
709 return "cc::HeadsUpDisplayLayerImpl"; 712 return "cc::HeadsUpDisplayLayerImpl";
710 } 713 }
711 714
712 void HeadsUpDisplayLayerImpl::AsValueInto(base::DictionaryValue* dict) const { 715 void HeadsUpDisplayLayerImpl::AsValueInto(base::DictionaryValue* dict) const {
713 LayerImpl::AsValueInto(dict); 716 LayerImpl::AsValueInto(dict);
714 dict->SetString("layer_name", "Heads Up Display Layer"); 717 dict->SetString("layer_name", "Heads Up Display Layer");
715 } 718 }
716 719
717 } // namespace cc 720 } // namespace cc
OLDNEW
« cc/debug/debug_colors.cc ('K') | « cc/debug/debug_colors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698