| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "sky/engine/core/frame/FrameView.h" | 50 #include "sky/engine/core/frame/FrameView.h" |
| 51 #include "sky/engine/core/frame/LocalFrame.h" | 51 #include "sky/engine/core/frame/LocalFrame.h" |
| 52 #include "sky/engine/core/inspector/InspectorTraceEvents.h" | 52 #include "sky/engine/core/inspector/InspectorTraceEvents.h" |
| 53 #include "sky/engine/core/page/Chrome.h" | 53 #include "sky/engine/core/page/Chrome.h" |
| 54 #include "sky/engine/core/page/EventHandler.h" | 54 #include "sky/engine/core/page/EventHandler.h" |
| 55 #include "sky/engine/core/page/FocusController.h" | 55 #include "sky/engine/core/page/FocusController.h" |
| 56 #include "sky/engine/core/page/Page.h" | 56 #include "sky/engine/core/page/Page.h" |
| 57 #include "sky/engine/core/rendering/HitTestResult.h" | 57 #include "sky/engine/core/rendering/HitTestResult.h" |
| 58 #include "sky/engine/core/rendering/RenderGeometryMap.h" | 58 #include "sky/engine/core/rendering/RenderGeometryMap.h" |
| 59 #include "sky/engine/core/rendering/RenderView.h" | 59 #include "sky/engine/core/rendering/RenderView.h" |
| 60 #include "sky/engine/core/rendering/compositing/RenderLayerCompositor.h" | |
| 61 #include "sky/engine/platform/PlatformGestureEvent.h" | 60 #include "sky/engine/platform/PlatformGestureEvent.h" |
| 62 #include "sky/engine/platform/PlatformMouseEvent.h" | 61 #include "sky/engine/platform/PlatformMouseEvent.h" |
| 63 #include "sky/engine/platform/graphics/GraphicsContextStateSaver.h" | 62 #include "sky/engine/platform/graphics/GraphicsContextStateSaver.h" |
| 64 #include "sky/engine/platform/graphics/GraphicsLayer.h" | 63 #include "sky/engine/platform/graphics/GraphicsLayer.h" |
| 65 #include "sky/engine/platform/scroll/ScrollAnimator.h" | 64 #include "sky/engine/platform/scroll/ScrollAnimator.h" |
| 66 #include "sky/engine/platform/scroll/Scrollbar.h" | 65 #include "sky/engine/platform/scroll/Scrollbar.h" |
| 67 #include "sky/engine/public/platform/Platform.h" | 66 #include "sky/engine/public/platform/Platform.h" |
| 68 | 67 |
| 69 namespace blink { | 68 namespace blink { |
| 70 | 69 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer",
"data", InspectorScrollLayerEvent::data(&box())); | 236 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer",
"data", InspectorScrollLayerEvent::data(&box())); |
| 238 | 237 |
| 239 const RenderLayerModelObject* paintInvalidationContainer = box().containerFo
rPaintInvalidation(); | 238 const RenderLayerModelObject* paintInvalidationContainer = box().containerFo
rPaintInvalidation(); |
| 240 | 239 |
| 241 // Update the positions of our child layers (if needed as only fixed layers
should be impacted by a scroll). | 240 // Update the positions of our child layers (if needed as only fixed layers
should be impacted by a scroll). |
| 242 // We don't update compositing layers, because we need to do a deep update f
rom the compositing ancestor. | 241 // We don't update compositing layers, because we need to do a deep update f
rom the compositing ancestor. |
| 243 if (!frameView->isInPerformLayout()) { | 242 if (!frameView->isInPerformLayout()) { |
| 244 // If we're in the middle of layout, we'll just update layers once layou
t has finished. | 243 // If we're in the middle of layout, we'll just update layers once layou
t has finished. |
| 245 layer()->clipper().clearClipRectsIncludingDescendants(); | 244 layer()->clipper().clearClipRectsIncludingDescendants(); |
| 246 box().setPreviousPaintInvalidationRect(box().boundsRectForPaintInvalidat
ion(paintInvalidationContainer)); | 245 box().setPreviousPaintInvalidationRect(box().boundsRectForPaintInvalidat
ion(paintInvalidationContainer)); |
| 247 updateCompositingLayersAfterScroll(); | |
| 248 } | 246 } |
| 249 | 247 |
| 250 // The caret rect needs to be invalidated after scrolling | 248 // The caret rect needs to be invalidated after scrolling |
| 251 frame->selection().setCaretRectNeedsUpdate(); | 249 frame->selection().setCaretRectNeedsUpdate(); |
| 252 | 250 |
| 253 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->previou
sPaintInvalidationRect()); | 251 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->previou
sPaintInvalidationRect()); |
| 254 | 252 |
| 255 quadForFakeMouseMoveEvent = paintInvalidationContainer->localToAbsoluteQuad(
quadForFakeMouseMoveEvent); | 253 quadForFakeMouseMoveEvent = paintInvalidationContainer->localToAbsoluteQuad(
quadForFakeMouseMoveEvent); |
| 256 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM
oveEvent); | 254 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM
oveEvent); |
| 257 | 255 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 m_scrollsOverflow = hasOverflow && isVisibleToHitTest; | 805 m_scrollsOverflow = hasOverflow && isVisibleToHitTest; |
| 808 if (didScrollOverflow == scrollsOverflow()) | 806 if (didScrollOverflow == scrollsOverflow()) |
| 809 return; | 807 return; |
| 810 | 808 |
| 811 if (m_scrollsOverflow) | 809 if (m_scrollsOverflow) |
| 812 frameView->addScrollableArea(this); | 810 frameView->addScrollableArea(this); |
| 813 else | 811 else |
| 814 frameView->removeScrollableArea(this); | 812 frameView->removeScrollableArea(this); |
| 815 } | 813 } |
| 816 | 814 |
| 817 void RenderLayerScrollableArea::updateCompositingLayersAfterScroll() | |
| 818 { | |
| 819 RenderLayerCompositor* compositor = box().view()->compositor(); | |
| 820 if (compositor->inCompositingMode()) { | |
| 821 layer()->setNeedsCompositingInputsUpdate(); | |
| 822 } | |
| 823 } | |
| 824 | |
| 825 static bool layerNeedsCompositedScrolling(const RenderLayer* layer) | |
| 826 { | |
| 827 return layer->scrollsOverflow() | |
| 828 && layer->compositor()->preferCompositingToLCDTextEnabled() | |
| 829 && !layer->hasDescendantWithClipPath() | |
| 830 && !layer->hasAncestorWithClipPath(); | |
| 831 } | |
| 832 | |
| 833 void RenderLayerScrollableArea::updateNeedsCompositedScrolling() | |
| 834 { | |
| 835 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(layer())
; | |
| 836 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin
g) { | |
| 837 m_needsCompositedScrolling = needsCompositedScrolling; | |
| 838 layer()->didUpdateNeedsCompositedScrolling(); | |
| 839 } | |
| 840 } | |
| 841 | |
| 842 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) | 815 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) |
| 843 { | 816 { |
| 844 // We only want to track the topmost scroll child for scrollable areas with | 817 // We only want to track the topmost scroll child for scrollable areas with |
| 845 // overlay scrollbars. | 818 // overlay scrollbars. |
| 846 if (!hasOverlayScrollbars()) | 819 if (!hasOverlayScrollbars()) |
| 847 return; | 820 return; |
| 848 m_nextTopmostScrollChild = scrollChild; | 821 m_nextTopmostScrollChild = scrollChild; |
| 849 } | 822 } |
| 850 | 823 |
| 851 } // namespace blink | 824 } // namespace blink |
| OLD | NEW |