OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/debug_colors.h" |
| 6 |
| 7 #include "cc/layer_tree_host_impl.h" |
| 8 |
| 9 namespace cc { |
| 10 |
| 11 static const float Scale(float width, const LayerTreeHostImpl* hostImpl) { |
| 12 return width * (hostImpl ? hostImpl->deviceScaleFactor() : 1); |
| 13 } |
| 14 |
| 15 // Tiled content layers are orange. |
| 16 SkColor DebugColors::kTiledContentLayerBorderColor() { return SkColorSetARGB(128
, 255, 128, 0); } |
| 17 int DebugColors::kTiledContentLayerBorderWidth(const LayerTreeHostImpl* host
Impl) { return Scale(2, hostImpl); } |
| 18 |
| 19 // Non-tiled content layers area green. |
| 20 SkColor DebugColors::kContentLayerBorderColor() { return SkColorSetARGB(128, 0,
128, 32); } |
| 21 int DebugColors::kContentLayerBorderWidth(const LayerTreeHostImpl* hostImpl)
{ return Scale(2, hostImpl); } |
| 22 |
| 23 // Masking layers are pale blue and wide. |
| 24 SkColor DebugColors::kMaskingLayerBorderColor() { return SkColorSetARGB(48, 128,
255, 255); } |
| 25 int DebugColors::kMaskingLayerBorderWidth(const LayerTreeHostImpl* hostImpl)
{ return Scale(20, hostImpl); } |
| 26 |
| 27 // Other container layers are yellow. |
| 28 SkColor DebugColors::kContainerLayerBorderColor() { return SkColorSetARGB(192, 2
55, 255, 0); } |
| 29 int DebugColors::kContainerLayerBorderWidth(const LayerTreeHostImpl* hostImp
l) { return Scale(2, hostImpl); } |
| 30 |
| 31 // Render surfaces are blue. |
| 32 SkColor DebugColors::kSurfaceBorderColor() { return SkColorSetARGB(100, 0, 0, 25
5); } |
| 33 SkColor DebugColors::kSurfaceBorderWidth(const LayerTreeHostImpl* hostImpl) { re
turn Scale(2, hostImpl); } |
| 34 |
| 35 // Replicas of render surfaces are purple. |
| 36 SkColor DebugColors::kSurfaceReplicaBorderColor() { return SkColorSetARGB(100, 1
60, 0, 255); } |
| 37 SkColor DebugColors::kSurfaceReplicaBorderWidth(const LayerTreeHostImpl* hostImp
l) { return Scale(2, hostImpl); } |
| 38 |
| 39 // Tile borders are cyan. |
| 40 SkColor DebugColors::kTileBorderColor() { return SkColorSetARGB(100, 80, 200, 20
0); } |
| 41 int DebugColors::kTileBorderWidth(const LayerTreeHostImpl* hostImpl) { retur
n Scale(1, hostImpl); } |
| 42 |
| 43 // Missing tile borders are red. |
| 44 SkColor DebugColors::kMissingTileBorderColor() { return SkColorSetARGB(100, 255,
0, 0); } |
| 45 int DebugColors::kMissingTileBorderWidth(const LayerTreeHostImpl* hostImpl)
{ return Scale(1, hostImpl); } |
| 46 |
| 47 // Culled tile borders are brown. |
| 48 SkColor DebugColors::kCulledTileBorderColor() { return SkColorSetARGB(120, 160,
100, 0); } |
| 49 int DebugColors::kCulledTileBorderWidth(const LayerTreeHostImpl* hostImpl) {
return Scale(1, hostImpl); } |
| 50 |
| 51 // Invalidated tiles get sky blue checkerboards. |
| 52 SkColor DebugColors::kInvalidatedTileCheckerboardColor() { return SkColorSetRGB(
128, 200, 245); } |
| 53 |
| 54 // Evicted tiles get pale red checkerboards. |
| 55 SkColor DebugColors::kEvictedTileCheckerboardColor() { return SkColorSetRGB(255,
200, 200); } |
| 56 |
| 57 } // namespace cc |
OLD | NEW |