| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/layer_impl.h" | 7 #include "cc/layer_impl.h" |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 return unscrolled; | 189 return unscrolled; |
| 190 | 190 |
| 191 m_scrollDelta = newDelta; | 191 m_scrollDelta = newDelta; |
| 192 if (m_scrollbarAnimationController) | 192 if (m_scrollbarAnimationController) |
| 193 m_scrollbarAnimationController->updateScrollOffset(this); | 193 m_scrollbarAnimationController->updateScrollOffset(this); |
| 194 noteLayerPropertyChangedForSubtree(); | 194 noteLayerPropertyChangedForSubtree(); |
| 195 | 195 |
| 196 return unscrolled; | 196 return unscrolled; |
| 197 } | 197 } |
| 198 | 198 |
| 199 InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const IntPoint& screenSpac
ePoint, InputHandlerClient::ScrollInputType type) const | 199 InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const gfx::Point& screenSp
acePoint, InputHandlerClient::ScrollInputType type) const |
| 200 { | 200 { |
| 201 if (shouldScrollOnMainThread()) { | 201 if (shouldScrollOnMainThread()) { |
| 202 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed shouldScrollOnMainThrea
d"); | 202 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed shouldScrollOnMainThrea
d"); |
| 203 return InputHandlerClient::ScrollOnMainThread; | 203 return InputHandlerClient::ScrollOnMainThread; |
| 204 } | 204 } |
| 205 | 205 |
| 206 if (!screenSpaceTransform().isInvertible()) { | 206 if (!screenSpaceTransform().isInvertible()) { |
| 207 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform
"); | 207 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform
"); |
| 208 return InputHandlerClient::ScrollIgnored; | 208 return InputHandlerClient::ScrollIgnored; |
| 209 } | 209 } |
| 210 | 210 |
| 211 if (!nonFastScrollableRegion().isEmpty()) { | 211 if (!nonFastScrollableRegion().IsEmpty()) { |
| 212 bool clipped = false; | 212 bool clipped = false; |
| 213 gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpac
eTransform().inverse(), FloatPoint(screenSpacePoint), clipped); | 213 gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpac
eTransform().inverse(), gfx::PointF(screenSpacePoint), clipped); |
| 214 if (!clipped && nonFastScrollableRegion().contains(cc::IntPoint(gfx::ToF
looredPoint(hitTestPointInLocalSpace)))) { | 214 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToFlooredPoint(h
itTestPointInLocalSpace))) { |
| 215 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe
gion"); | 215 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe
gion"); |
| 216 return InputHandlerClient::ScrollOnMainThread; | 216 return InputHandlerClient::ScrollOnMainThread; |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { | 220 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { |
| 221 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); | 221 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); |
| 222 return InputHandlerClient::ScrollOnMainThread; | 222 return InputHandlerClient::ScrollOnMainThread; |
| 223 } | 223 } |
| 224 | 224 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 if (m_doubleSided == doubleSided) | 653 if (m_doubleSided == doubleSided) |
| 654 return; | 654 return; |
| 655 | 655 |
| 656 m_doubleSided = doubleSided; | 656 m_doubleSided = doubleSided; |
| 657 noteLayerPropertyChangedForSubtree(); | 657 noteLayerPropertyChangedForSubtree(); |
| 658 } | 658 } |
| 659 | 659 |
| 660 Region LayerImpl::visibleContentOpaqueRegion() const | 660 Region LayerImpl::visibleContentOpaqueRegion() const |
| 661 { | 661 { |
| 662 if (contentsOpaque()) | 662 if (contentsOpaque()) |
| 663 return cc::IntRect(visibleContentRect()); | 663 return visibleContentRect(); |
| 664 return Region(); | 664 return Region(); |
| 665 } | 665 } |
| 666 | 666 |
| 667 void LayerImpl::didLoseContext() | 667 void LayerImpl::didLoseContext() |
| 668 { | 668 { |
| 669 } | 669 } |
| 670 | 670 |
| 671 void LayerImpl::setMaxScrollPosition(const IntSize& maxScrollPosition) | 671 void LayerImpl::setMaxScrollPosition(const IntSize& maxScrollPosition) |
| 672 { | 672 { |
| 673 m_maxScrollPosition = maxScrollPosition; | 673 m_maxScrollPosition = maxScrollPosition; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 697 | 697 |
| 698 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 698 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
| 699 { | 699 { |
| 700 if (!m_scrollbarAnimationController) | 700 if (!m_scrollbarAnimationController) |
| 701 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); | 701 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); |
| 702 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 702 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 703 m_scrollbarAnimationController->updateScrollOffset(this); | 703 m_scrollbarAnimationController->updateScrollOffset(this); |
| 704 } | 704 } |
| 705 | 705 |
| 706 } | 706 } |
| OLD | NEW |