| OLD | NEW |
| 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 Loading... |
| 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::kContentLayerBorderColor(); |
| 158 *color = SkColorSetARGB(128, 0, 128, 32); | 159 *width = DebugColors::kContentLayerBorderWidth(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::kMaskingLayerBorderColor(); |
| 165 *color = SkColorSetARGB(48, 128, 255, 255); | 165 *width = DebugColors::kMaskingLayerBorderWidth(m_layerTreeHostImpl); |
| 166 *width = 20; | |
| 167 return; | 166 return; |
| 168 } | 167 } |
| 169 | 168 |
| 170 // Other container layers are yellow. | 169 *color = DebugColors::kContainerLayerBorderColor(); |
| 171 *color = SkColorSetARGB(192, 255, 255, 0); | 170 *width = DebugColors::kContainerLayerBorderWidth(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 Loading... |
| 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 |
| OLD | NEW |