| 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/geometry.h" | 10 #include "cc/geometry.h" |
| 11 #include "cc/layer_sorter.h" | 11 #include "cc/layer_sorter.h" |
| 12 #include "cc/layer_tree_host_impl.h" |
| 12 #include "cc/math_util.h" | 13 #include "cc/math_util.h" |
| 13 #include "cc/proxy.h" | 14 #include "cc/proxy.h" |
| 14 #include "cc/quad_sink.h" | 15 #include "cc/quad_sink.h" |
| 15 #include "cc/scrollbar_animation_controller.h" | 16 #include "cc/scrollbar_animation_controller.h" |
| 16 #include "cc/settings.h" | |
| 17 #include "third_party/skia/include/core/SkImageFilter.h" | 17 #include "third_party/skia/include/core/SkImageFilter.h" |
| 18 #include "ui/gfx/point_conversions.h" | 18 #include "ui/gfx/point_conversions.h" |
| 19 #include "ui/gfx/rect_conversions.h" | 19 #include "ui/gfx/rect_conversions.h" |
| 20 | 20 |
| 21 using WebKit::WebTransformationMatrix; | 21 using WebKit::WebTransformationMatrix; |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 LayerImpl::LayerImpl(int id) | 25 LayerImpl::LayerImpl(int id) |
| 26 : m_parent(0) | 26 : m_parent(0) |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 if (!scrollable()) { | 227 if (!scrollable()) { |
| 228 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored not scrollable"); | 228 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored not scrollable"); |
| 229 return InputHandlerClient::ScrollIgnored; | 229 return InputHandlerClient::ScrollIgnored; |
| 230 } | 230 } |
| 231 | 231 |
| 232 return InputHandlerClient::ScrollStarted; | 232 return InputHandlerClient::ScrollStarted; |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool LayerImpl::drawCheckerboardForMissingTiles() const | 235 bool LayerImpl::drawCheckerboardForMissingTiles() const |
| 236 { | 236 { |
| 237 return m_drawCheckerboardForMissingTiles && !Settings::backgroundColorInstea
dOfCheckerboard(); | 237 return m_drawCheckerboardForMissingTiles && !m_layerTreeHostImpl->settings()
.backgroundColorInsteadOfCheckerboard; |
| 238 } | 238 } |
| 239 | 239 |
| 240 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const | 240 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const |
| 241 { | 241 { |
| 242 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); | 242 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); |
| 243 // Intersect with content rect to avoid the extra pixel because for some | 243 // Intersect with content rect to avoid the extra pixel because for some |
| 244 // values x and y, ceil((x / y) * y) may be x + 1. | 244 // values x and y, ceil((x / y) * y) may be x + 1. |
| 245 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 245 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
| 246 return gfx::ToEnclosingRect(contentRect); | 246 return gfx::ToEnclosingRect(contentRect); |
| 247 } | 247 } |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 | 705 |
| 706 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 706 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
| 707 { | 707 { |
| 708 if (!m_scrollbarAnimationController) | 708 if (!m_scrollbarAnimationController) |
| 709 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); | 709 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); |
| 710 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 710 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 711 m_scrollbarAnimationController->updateScrollOffset(this); | 711 m_scrollbarAnimationController->updateScrollOffset(this); |
| 712 } | 712 } |
| 713 | 713 |
| 714 } // namespace cc | 714 } // namespace cc |
| OLD | NEW |