summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorcaseq@chromium.org <caseq@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-20 18:49:38 +0000
committercaseq@chromium.org <caseq@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-20 18:49:38 +0000
commit9376b75a8cc121f025fb584fccf5a64dbacc2b9e (patch)
tree2aeddd972a2d9422ba83c79886201fed4328feb1 /cc
parenta5317ac1a3c8cc7752f88db64727ef05ff2d264d (diff)
downloadchromium_src-9376b75a8cc121f025fb584fccf5a64dbacc2b9e.zip
chromium_src-9376b75a8cc121f025fb584fccf5a64dbacc2b9e.tar.gz
chromium_src-9376b75a8cc121f025fb584fccf5a64dbacc2b9e.tar.bz2
Do not cycle through 3 shades of green when showing paint rects in HUD
Make them all use one shade of green to avoid excessive flickery. This effectivale reverts r251953 ( https://codereview.chromium.org/121223002), though the single paint color is still green. We plan to eventually change to green that fades with time after last paint. BUG=324535 Review URL: https://codereview.chromium.org/172123002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/debug/debug_colors.cc20
-rw-r--r--cc/debug/debug_colors.h4
-rw-r--r--cc/layers/heads_up_display_layer_impl.cc13
-rw-r--r--cc/layers/heads_up_display_layer_impl.h6
4 files changed, 15 insertions, 28 deletions
diff --git a/cc/debug/debug_colors.cc b/cc/debug/debug_colors.cc
index 6c7b055..353bd79 100644
--- a/cc/debug/debug_colors.cc
+++ b/cc/debug/debug_colors.cc
@@ -173,23 +173,13 @@ SkColor DebugColors::EvictedTileCheckerboardColor() {
// ======= Debug rect colors =======
-// Paint rects in shades of green.
-static const int kPaintRectColors[][3] = {{0, 155, 0}, {0, 195, 0},
- {0, 235, 0}};
-SkColor DebugColors::PaintRectBorderColor(int color_index) {
- int real_index = color_index % arraysize(kPaintRectColors);
- return SkColorSetARGB(255,
- kPaintRectColors[real_index][0],
- kPaintRectColors[real_index][1],
- kPaintRectColors[real_index][2]);
+// Paint rects in green.
+SkColor DebugColors::PaintRectBorderColor() {
+ return SkColorSetARGB(255, 0, 195, 0);
}
int DebugColors::PaintRectBorderWidth() { return 2; }
-SkColor DebugColors::PaintRectFillColor(int color_index) {
- int real_index = color_index % arraysize(kPaintRectColors);
- return SkColorSetARGB(30,
- kPaintRectColors[real_index][0],
- kPaintRectColors[real_index][1],
- kPaintRectColors[real_index][2]);
+SkColor DebugColors::PaintRectFillColor() {
+ return SkColorSetARGB(30, 0, 195, 0);
}
// Property-changed rects in blue.
diff --git a/cc/debug/debug_colors.h b/cc/debug/debug_colors.h
index 062cedf..2c35c4a 100644
--- a/cc/debug/debug_colors.h
+++ b/cc/debug/debug_colors.h
@@ -69,9 +69,9 @@ class DebugColors {
static SkColor EvictedTileCheckerboardColor();
static SkColor InvalidatedTileCheckerboardColor();
- static SkColor PaintRectBorderColor(int color_index);
+ static SkColor PaintRectBorderColor();
static int PaintRectBorderWidth();
- static SkColor PaintRectFillColor(int color_index);
+ static SkColor PaintRectFillColor();
static SkColor PropertyChangedRectBorderColor();
static int PropertyChangedRectBorderWidth();
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index e3c98dd5..be5af99 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -71,8 +71,7 @@ HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl,
typeface_(skia::AdoptRef(
SkTypeface::CreateFromName("monospace", SkTypeface::kBold))),
fps_graph_(60.0, 80.0),
- paint_time_graph_(16.0, 48.0),
- current_paint_rect_color_(0) {}
+ paint_time_graph_(16.0, 48.0) {}
HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {}
@@ -226,7 +225,7 @@ void HeadsUpDisplayLayerImpl::UpdateHudContents() {
paint_time_graph_.UpdateUpperBound();
}
-void HeadsUpDisplayLayerImpl::DrawHudContents(SkCanvas* canvas) {
+void HeadsUpDisplayLayerImpl::DrawHudContents(SkCanvas* canvas) const {
const LayerTreeDebugState& debug_state = layer_tree_impl()->debug_state();
if (debug_state.ShowHudRects())
@@ -589,10 +588,9 @@ SkRect HeadsUpDisplayLayerImpl::DrawPaintTimeDisplay(
void HeadsUpDisplayLayerImpl::DrawDebugRects(
SkCanvas* canvas,
- DebugRectHistory* debug_rect_history) {
+ DebugRectHistory* debug_rect_history) const {
const std::vector<DebugRect>& debug_rects = debug_rect_history->debug_rects();
SkPaint paint = CreatePaint();
- current_paint_rect_color_++;
for (size_t i = 0; i < debug_rects.size(); ++i) {
SkColor stroke_color = 0;
@@ -602,9 +600,8 @@ void HeadsUpDisplayLayerImpl::DrawDebugRects(
switch (debug_rects[i].type) {
case PAINT_RECT_TYPE:
- stroke_color =
- DebugColors::PaintRectBorderColor(current_paint_rect_color_);
- fill_color = DebugColors::PaintRectFillColor(current_paint_rect_color_);
+ stroke_color = DebugColors::PaintRectBorderColor();
+ fill_color = DebugColors::PaintRectFillColor();
stroke_width = DebugColors::PaintRectBorderWidth();
break;
case PROPERTY_CHANGED_RECT_TYPE:
diff --git a/cc/layers/heads_up_display_layer_impl.h b/cc/layers/heads_up_display_layer_impl.h
index a5ed9a2..47afa1f 100644
--- a/cc/layers/heads_up_display_layer_impl.h
+++ b/cc/layers/heads_up_display_layer_impl.h
@@ -73,7 +73,7 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE;
void UpdateHudContents();
- void DrawHudContents(SkCanvas* canvas);
+ void DrawHudContents(SkCanvas* canvas) const;
void DrawText(SkCanvas* canvas,
SkPaint* paint,
@@ -108,7 +108,8 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
const PaintTimeCounter* paint_time_counter,
int top,
int right) const;
- void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history);
+ void DrawDebugRects(SkCanvas* canvas,
+ DebugRectHistory* debug_rect_history) const;
scoped_ptr<ScopedResource> hud_resource_;
scoped_ptr<SkCanvas> hud_canvas_;
@@ -118,7 +119,6 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
Graph fps_graph_;
Graph paint_time_graph_;
MemoryHistory::Entry memory_entry_;
- int current_paint_rect_color_;
base::TimeTicks time_of_last_graph_update_;