Chromium Code Reviews| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 | 299 |
| 300 if (box().view()->compositor()->inCompositingMode()) { | 300 if (box().view()->compositor()->inCompositingMode()) { |
| 301 // Hits in virtual/gpu/fast/canvas/canvas-scroll-path-into-view.html. | 301 // Hits in virtual/gpu/fast/canvas/canvas-scroll-path-into-view.html. |
| 302 DisableCompositingQueryAsserts disabler; | 302 DisableCompositingQueryAsserts disabler; |
| 303 bool onlyScrolledCompositedLayers = scrollsOverflow() | 303 bool onlyScrolledCompositedLayers = scrollsOverflow() |
| 304 && !layer()->hasVisibleNonLayerContent() | 304 && !layer()->hasVisibleNonLayerContent() |
| 305 && !layer()->hasNonCompositedChild() | 305 && !layer()->hasNonCompositedChild() |
| 306 && !layer()->hasBlockSelectionGapBounds() | 306 && !layer()->hasBlockSelectionGapBounds() |
| 307 && box().style()->backgroundLayers().attachment() != LocalBackground Attachment; | 307 && box().style()->backgroundLayers().attachment() != LocalBackground Attachment; |
| 308 | 308 |
| 309 if (usesCompositedScrolling() || onlyScrolledCompositedLayers) | 309 if (onlyScrolledCompositedLayers) |
|
rafaelw
2014/11/07 19:41:48
Given the name of this bool, I might guess that th
abarth-chromium
2014/11/07 19:44:23
That sounds right.
| |
| 310 requiresPaintInvalidation = false; | 310 requiresPaintInvalidation = false; |
| 311 } | 311 } |
| 312 | 312 |
| 313 // Just schedule a full paint invalidation of our object. | 313 // Just schedule a full paint invalidation of our object. |
| 314 if (requiresPaintInvalidation) { | 314 if (requiresPaintInvalidation) { |
| 315 // For querying RenderLayer::compositingState() | 315 // For querying RenderLayer::compositingState() |
| 316 // This code appears correct, since scrolling outside of layout happens during activities that do not dirty compositing state. | 316 // This code appears correct, since scrolling outside of layout happens during activities that do not dirty compositing state. |
| 317 DisableCompositingQueryAsserts disabler; | 317 DisableCompositingQueryAsserts disabler; |
| 318 if (box().frameView()->isInPerformLayout()) | 318 if (box().frameView()->isInPerformLayout()) |
| 319 box().setShouldDoFullPaintInvalidation(true); | 319 box().setShouldDoFullPaintInvalidation(true); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 return box().frame() ? box().frame()->eventHandler().lastKnownMousePosition( ) : IntPoint(); | 381 return box().frame() ? box().frame()->eventHandler().lastKnownMousePosition( ) : IntPoint(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 IntRect RenderLayerScrollableArea::scrollableAreaBoundingBox() const | 384 IntRect RenderLayerScrollableArea::scrollableAreaBoundingBox() const |
| 385 { | 385 { |
| 386 return box().absoluteBoundingBoxRect(); | 386 return box().absoluteBoundingBoxRect(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 bool RenderLayerScrollableArea::userInputScrollable(ScrollbarOrientation orienta tion) const | 389 bool RenderLayerScrollableArea::userInputScrollable(ScrollbarOrientation orienta tion) const |
| 390 { | 390 { |
| 391 if (box().isIntristicallyScrollable(orientation)) | |
| 392 return true; | |
| 393 | |
| 394 EOverflow overflowStyle = (orientation == HorizontalScrollbar) ? | 391 EOverflow overflowStyle = (orientation == HorizontalScrollbar) ? |
| 395 box().style()->overflowX() : box().style()->overflowY(); | 392 box().style()->overflowX() : box().style()->overflowY(); |
| 396 return (overflowStyle == OSCROLL || overflowStyle == OAUTO || overflowStyle == OOVERLAY); | 393 return (overflowStyle == OSCROLL || overflowStyle == OAUTO || overflowStyle == OOVERLAY); |
| 397 } | 394 } |
| 398 | 395 |
| 399 bool RenderLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const | 396 bool RenderLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const |
| 400 { | 397 { |
| 401 return box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); | 398 return box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); |
| 402 } | 399 } |
| 403 | 400 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 903 if (m_scrollsOverflow) | 900 if (m_scrollsOverflow) |
| 904 frameView->addScrollableArea(this); | 901 frameView->addScrollableArea(this); |
| 905 else | 902 else |
| 906 frameView->removeScrollableArea(this); | 903 frameView->removeScrollableArea(this); |
| 907 } | 904 } |
| 908 | 905 |
| 909 void RenderLayerScrollableArea::updateCompositingLayersAfterScroll() | 906 void RenderLayerScrollableArea::updateCompositingLayersAfterScroll() |
| 910 { | 907 { |
| 911 RenderLayerCompositor* compositor = box().view()->compositor(); | 908 RenderLayerCompositor* compositor = box().view()->compositor(); |
| 912 if (compositor->inCompositingMode()) { | 909 if (compositor->inCompositingMode()) { |
| 913 if (usesCompositedScrolling()) { | 910 layer()->setNeedsCompositingInputsUpdate(); |
| 914 DisableCompositingQueryAsserts disabler; | |
| 915 ASSERT(layer()->hasCompositedLayerMapping()); | |
| 916 layer()->compositedLayerMapping()->setNeedsGraphicsLayerUpdate(Graph icsLayerUpdateSubtree); | |
| 917 compositor->setNeedsCompositingUpdate(CompositingUpdateAfterGeometry Change); | |
| 918 } else { | |
| 919 layer()->setNeedsCompositingInputsUpdate(); | |
| 920 } | |
| 921 } | 911 } |
| 922 } | 912 } |
| 923 | 913 |
| 924 bool RenderLayerScrollableArea::usesCompositedScrolling() const | |
| 925 { | |
| 926 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling | |
| 927 if (box().isIntristicallyScrollable(VerticalScrollbar) || box().isIntristica llyScrollable(HorizontalScrollbar)) | |
| 928 return false; | |
| 929 | |
| 930 // See https://codereview.chromium.org/176633003/ for the tests that fail wi thout this disabler. | |
| 931 DisableCompositingQueryAsserts disabler; | |
| 932 return layer()->hasCompositedLayerMapping() && layer()->compositedLayerMappi ng()->scrollingLayer(); | |
| 933 } | |
| 934 | |
| 935 static bool layerNeedsCompositedScrolling(const RenderLayer* layer) | 914 static bool layerNeedsCompositedScrolling(const RenderLayer* layer) |
| 936 { | 915 { |
| 937 return layer->scrollsOverflow() | 916 return layer->scrollsOverflow() |
| 938 && layer->compositor()->preferCompositingToLCDTextEnabled() | 917 && layer->compositor()->preferCompositingToLCDTextEnabled() |
| 939 && !layer->hasDescendantWithClipPath() | 918 && !layer->hasDescendantWithClipPath() |
| 940 && !layer->hasAncestorWithClipPath(); | 919 && !layer->hasAncestorWithClipPath(); |
| 941 } | 920 } |
| 942 | 921 |
| 943 void RenderLayerScrollableArea::updateNeedsCompositedScrolling() | 922 void RenderLayerScrollableArea::updateNeedsCompositedScrolling() |
| 944 { | 923 { |
| 945 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(layer()) ; | 924 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(layer()) ; |
| 946 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) { | 925 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) { |
| 947 m_needsCompositedScrolling = needsCompositedScrolling; | 926 m_needsCompositedScrolling = needsCompositedScrolling; |
| 948 layer()->didUpdateNeedsCompositedScrolling(); | 927 layer()->didUpdateNeedsCompositedScrolling(); |
| 949 } | 928 } |
| 950 } | 929 } |
| 951 | 930 |
| 952 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) | 931 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) |
| 953 { | 932 { |
| 954 // We only want to track the topmost scroll child for scrollable areas with | 933 // We only want to track the topmost scroll child for scrollable areas with |
| 955 // overlay scrollbars. | 934 // overlay scrollbars. |
| 956 if (!hasOverlayScrollbars()) | 935 if (!hasOverlayScrollbars()) |
| 957 return; | 936 return; |
| 958 m_nextTopmostScrollChild = scrollChild; | 937 m_nextTopmostScrollChild = scrollChild; |
| 959 } | 938 } |
| 960 | 939 |
| 961 } // namespace blink | 940 } // namespace blink |
| OLD | NEW |