Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/WebMutable/WebCompositorMutable/g Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "core/page/Page.h" 68 #include "core/page/Page.h"
69 #include "core/page/scrolling/ScrollingCoordinator.h" 69 #include "core/page/scrolling/ScrollingCoordinator.h"
70 #include "core/paint/PaintLayerFragment.h" 70 #include "core/paint/PaintLayerFragment.h"
71 #include "platform/PlatformGestureEvent.h" 71 #include "platform/PlatformGestureEvent.h"
72 #include "platform/PlatformMouseEvent.h" 72 #include "platform/PlatformMouseEvent.h"
73 #include "platform/graphics/GraphicsLayer.h" 73 #include "platform/graphics/GraphicsLayer.h"
74 #include "platform/graphics/paint/DrawingRecorder.h" 74 #include "platform/graphics/paint/DrawingRecorder.h"
75 #include "platform/scroll/ScrollAnimatorBase.h" 75 #include "platform/scroll/ScrollAnimatorBase.h"
76 #include "platform/scroll/ScrollbarTheme.h" 76 #include "platform/scroll/ScrollbarTheme.h"
77 #include "public/platform/Platform.h" 77 #include "public/platform/Platform.h"
78 #include "public/platform/WebCompositorMutableProperties.h"
78 79
79 namespace blink { 80 namespace blink {
80 81
81 const int ResizerControlExpandRatioForTouch = 2; 82 const int ResizerControlExpandRatioForTouch = 2;
82 83
83 PaintLayerScrollableArea::PaintLayerScrollableArea(PaintLayer& layer) 84 PaintLayerScrollableArea::PaintLayerScrollableArea(PaintLayer& layer)
84 : m_layer(layer) 85 : m_layer(layer)
85 , m_inResizeMode(false) 86 , m_inResizeMode(false)
86 , m_scrollsOverflow(false) 87 , m_scrollsOverflow(false)
87 , m_inOverflowRelayout(false) 88 , m_inOverflowRelayout(false)
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 if (box().isIntrinsicallyScrollable(VerticalScrollbar) || box().isIntrinsica llyScrollable(HorizontalScrollbar)) 1431 if (box().isIntrinsicallyScrollable(VerticalScrollbar) || box().isIntrinsica llyScrollable(HorizontalScrollbar))
1431 return false; 1432 return false;
1432 1433
1433 // See https://codereview.chromium.org/176633003/ for the tests that fail wi thout this disabler. 1434 // See https://codereview.chromium.org/176633003/ for the tests that fail wi thout this disabler.
1434 DisableCompositingQueryAsserts disabler; 1435 DisableCompositingQueryAsserts disabler;
1435 return layer()->hasCompositedLayerMapping() && layer()->compositedLayerMappi ng()->scrollingLayer(); 1436 return layer()->hasCompositedLayerMapping() && layer()->compositedLayerMappi ng()->scrollingLayer();
1436 } 1437 }
1437 1438
1438 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode mode, const PaintLayer* layer) 1439 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode mode, const PaintLayer* layer)
1439 { 1440 {
1441 if (!layer->scrollsOverflow())
1442 return false;
1443
1444 Node* node = layer->enclosingElement();
1445 if (node && node->isElementNode() && (toElement(node)->mutableProperties() & (WebCompositorMutablePropertyScrollTop | WebCompositorMutablePropertyScrollLeft )))
1446 return true;
1447
1440 if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor( )->preferCompositingToLCDTextEnabled()) 1448 if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor( )->preferCompositingToLCDTextEnabled())
1441 return false; 1449 return false;
1442 1450
1443 return layer->scrollsOverflow() 1451 return !layer->hasDescendantWithClipPath()
1444 && !layer->hasDescendantWithClipPath()
1445 && !layer->hasAncestorWithClipPath() 1452 && !layer->hasAncestorWithClipPath()
1446 && !layer->layoutObject()->style()->hasBorderRadius(); 1453 && !layer->layoutObject()->style()->hasBorderRadius();
1447 } 1454 }
1448 1455
1449 void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) 1456 void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode)
1450 { 1457 {
1451 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la yer()); 1458 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la yer());
1452 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) { 1459 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) {
1453 m_needsCompositedScrolling = needsCompositedScrolling; 1460 m_needsCompositedScrolling = needsCompositedScrolling;
1454 layer()->didUpdateNeedsCompositedScrolling(); 1461 layer()->didUpdateNeedsCompositedScrolling();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 } 1583 }
1577 1584
1578 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1585 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1579 { 1586 {
1580 visitor->trace(m_scrollableArea); 1587 visitor->trace(m_scrollableArea);
1581 visitor->trace(m_hBar); 1588 visitor->trace(m_hBar);
1582 visitor->trace(m_vBar); 1589 visitor->trace(m_vBar);
1583 } 1590 }
1584 1591
1585 } // namespace blink 1592 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698