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

Side by Side Diff: cc/debug_colors.cc

Issue 12326022: Efficiently handle image layer scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win warnings Created 7 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
« no previous file with comments | « cc/debug_colors.h ('k') | cc/picture_image_layer.h » ('j') | 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/debug_colors.h" 5 #include "cc/debug_colors.h"
6 6
7 #include "cc/layer_tree_impl.h" 7 #include "cc/layer_tree_impl.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 static const float Scale(float width, const LayerTreeImpl* tree_impl) { 11 static const float Scale(float width, const LayerTreeImpl* tree_impl) {
12 return width * (tree_impl ? tree_impl->device_scale_factor() : 1); 12 return width * (tree_impl ? tree_impl->device_scale_factor() : 1);
13 } 13 }
14 14
15 // ======= Layer border colors ======= 15 // ======= Layer border colors =======
16 16
17 // Tiled content layers are orange. 17 // Tiled content layers are orange.
18 SkColor DebugColors::TiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); } 18 SkColor DebugColors::TiledContentLayerBorderColor() { return SkColorSetARGB(128, 255, 128, 0); }
19 int DebugColors::TiledContentLayerBorderWidth(const LayerTreeImpl* tree_impl) { return Scale(2, tree_impl); } 19 int DebugColors::TiledContentLayerBorderWidth(const LayerTreeImpl* tree_impl) { return Scale(2, tree_impl); }
20 20
21 // Image layers are olive.
22 SkColor DebugColors::ImageLayerBorderColor() { return SkColorSetARGB(128, 128, 1 28, 0); }
23 int DebugColors::ImageLayerBorderWidth(const LayerTreeImpl* tree_impl) { return Scale(2, tree_impl); }
24
21 // Non-tiled content layers area green. 25 // Non-tiled content layers area green.
22 SkColor DebugColors::ContentLayerBorderColor() { return SkColorSetARGB(128, 0, 1 28, 32); } 26 SkColor DebugColors::ContentLayerBorderColor() { return SkColorSetARGB(128, 0, 1 28, 32); }
23 int DebugColors::ContentLayerBorderWidth(const LayerTreeImpl* tree_impl) { retur n Scale(2, tree_impl); } 27 int DebugColors::ContentLayerBorderWidth(const LayerTreeImpl* tree_impl) { retur n Scale(2, tree_impl); }
24 28
25 // Masking layers are pale blue and wide. 29 // Masking layers are pale blue and wide.
26 SkColor DebugColors::MaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); } 30 SkColor DebugColors::MaskingLayerBorderColor() { return SkColorSetARGB(48, 128, 255, 255); }
27 int DebugColors::MaskingLayerBorderWidth(const LayerTreeImpl* tree_impl) { retur n Scale(20, tree_impl); } 31 int DebugColors::MaskingLayerBorderWidth(const LayerTreeImpl* tree_impl) { retur n Scale(20, tree_impl); }
28 32
29 // Other container layers are yellow. 33 // Other container layers are yellow.
30 SkColor DebugColors::ContainerLayerBorderColor() { return SkColorSetARGB(192, 25 5, 255, 0); } 34 SkColor DebugColors::ContainerLayerBorderColor() { return SkColorSetARGB(192, 25 5, 255, 0); }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 124
121 // ======= HUD widget colors ======= 125 // ======= HUD widget colors =======
122 126
123 SkColor DebugColors::PlatformLayerTreeTextColor() { return SK_ColorRED; } 127 SkColor DebugColors::PlatformLayerTreeTextColor() { return SK_ColorRED; }
124 SkColor DebugColors::FPSDisplayTextAndGraphColor() { return SK_ColorRED; } 128 SkColor DebugColors::FPSDisplayTextAndGraphColor() { return SK_ColorRED; }
125 129
126 // Paint time display has the same green as used for paint time in the WebInspec tor 130 // Paint time display has the same green as used for paint time in the WebInspec tor
127 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { return SkColorSetRGB( 95, 160, 80); } 131 SkColor DebugColors::PaintTimeDisplayTextAndGraphColor() { return SkColorSetRGB( 95, 160, 80); }
128 132
129 } // namespace cc 133 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug_colors.h ('k') | cc/picture_image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698