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

Side by Side Diff: cc/layer_impl.cc

Issue 11316026: cc: Create cc::DebugColors class to hold all the debugging color/width constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/debug_colors.cc ('k') | cc/quad_culler.cc » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_impl.h" 5 #include "cc/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "cc/debug_border_draw_quad.h" 9 #include "cc/debug_border_draw_quad.h"
10 #include "cc/debug_colors.h"
10 #include "cc/geometry.h" 11 #include "cc/geometry.h"
11 #include "cc/layer_sorter.h" 12 #include "cc/layer_sorter.h"
12 #include "cc/layer_tree_host_impl.h" 13 #include "cc/layer_tree_host_impl.h"
13 #include "cc/math_util.h" 14 #include "cc/math_util.h"
14 #include "cc/proxy.h" 15 #include "cc/proxy.h"
15 #include "cc/quad_sink.h" 16 #include "cc/quad_sink.h"
16 #include "cc/scrollbar_animation_controller.h" 17 #include "cc/scrollbar_animation_controller.h"
17 #include "third_party/skia/include/core/SkImageFilter.h" 18 #include "third_party/skia/include/core/SkImageFilter.h"
18 #include "ui/gfx/point_conversions.h" 19 #include "ui/gfx/point_conversions.h"
19 #include "ui/gfx/rect_conversions.h" 20 #include "ui/gfx/rect_conversions.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 bool LayerImpl::showDebugBorders() const 148 bool LayerImpl::showDebugBorders() const
148 { 149 {
149 if (!m_layerTreeHostImpl) 150 if (!m_layerTreeHostImpl)
150 return false; 151 return false;
151 return m_layerTreeHostImpl->settings().showDebugBorders; 152 return m_layerTreeHostImpl->settings().showDebugBorders;
152 } 153 }
153 154
154 void LayerImpl::getDebugBorderProperties(SkColor* color, float* width) const 155 void LayerImpl::getDebugBorderProperties(SkColor* color, float* width) const
155 { 156 {
156 if (m_drawsContent) { 157 if (m_drawsContent) {
157 // Non-tiled content layers are green. 158 *color = DebugColors::ContentLayerBorderColor();
158 *color = SkColorSetARGB(128, 0, 128, 32); 159 *width = DebugColors::ContentLayerBorderWidth(m_layerTreeHostImpl);
159 *width = 2;
160 return; 160 return;
161 } 161 }
162 162
163 if (m_masksToBounds) { 163 if (m_masksToBounds) {
164 // Masking layers are pale blue. 164 *color = DebugColors::MaskingLayerBorderColor();
165 *color = SkColorSetARGB(48, 128, 255, 255); 165 *width = DebugColors::MaskingLayerBorderWidth(m_layerTreeHostImpl);
166 *width = 20;
167 return; 166 return;
168 } 167 }
169 168
170 // Other container layers are yellow. 169 *color = DebugColors::ContainerLayerBorderColor();
171 *color = SkColorSetARGB(192, 255, 255, 0); 170 *width = DebugColors::ContainerLayerBorderWidth(m_layerTreeHostImpl);
172 *width = 2;
173 } 171 }
174 172
175 void LayerImpl::appendDebugBorderQuad(QuadSink& quadList, const SharedQuadState* sharedQuadState, AppendQuadsData& appendQuadsData) const 173 void LayerImpl::appendDebugBorderQuad(QuadSink& quadList, const SharedQuadState* sharedQuadState, AppendQuadsData& appendQuadsData) const
176 { 174 {
177 if (!showDebugBorders()) 175 if (!showDebugBorders())
178 return; 176 return;
179 177
180 SkColor color; 178 SkColor color;
181 float width; 179 float width;
182 getDebugBorderProperties(&color, &width); 180 getDebugBorderProperties(&color, &width);
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 710
713 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) 711 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
714 { 712 {
715 if (!m_scrollbarAnimationController) 713 if (!m_scrollbarAnimationController)
716 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); 714 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is);
717 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 715 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
718 m_scrollbarAnimationController->updateScrollOffset(this); 716 m_scrollbarAnimationController->updateScrollOffset(this);
719 } 717 }
720 718
721 } // namespace cc 719 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug_colors.cc ('k') | cc/quad_culler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698