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

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: . Created 5 years 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 if (box().isIntrinsicallyScrollable(VerticalScrollbar) || box().isIntrinsica llyScrollable(HorizontalScrollbar)) 1375 if (box().isIntrinsicallyScrollable(VerticalScrollbar) || box().isIntrinsica llyScrollable(HorizontalScrollbar))
1375 return false; 1376 return false;
1376 1377
1377 // See https://codereview.chromium.org/176633003/ for the tests that fail wi thout this disabler. 1378 // See https://codereview.chromium.org/176633003/ for the tests that fail wi thout this disabler.
1378 DisableCompositingQueryAsserts disabler; 1379 DisableCompositingQueryAsserts disabler;
1379 return layer()->hasCompositedLayerMapping() && layer()->compositedLayerMappi ng()->scrollingLayer(); 1380 return layer()->hasCompositedLayerMapping() && layer()->compositedLayerMappi ng()->scrollingLayer();
1380 } 1381 }
1381 1382
1382 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode mode, const PaintLayer* layer) 1383 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode mode, const PaintLayer* layer)
1383 { 1384 {
1385 if (!layer->scrollsOverflow())
1386 return false;
1387
1388 Node* node = layer->enclosingElement();
esprehn 2015/12/02 03:28:49 heh, enclosingElement needs to be renamed enclosin
Ian Vollick 2015/12/03 17:54:43 Sounds good. Here's a cleanup cl for that: https:/
Ian Vollick 2015/12/03 22:33:02 enclosingNode been landed and I've rebased this ch
1389 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp erties() & (WebCompositorMutablePropertyScrollTop | WebCompositorMutableProperty ScrollLeft)))
1390 return true;
1391
1384 if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor( )->preferCompositingToLCDTextEnabled()) 1392 if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor( )->preferCompositingToLCDTextEnabled())
1385 return false; 1393 return false;
1386 1394
1387 return layer->scrollsOverflow() 1395 return !layer->hasDescendantWithClipPath()
1388 && !layer->hasDescendantWithClipPath()
1389 && !layer->hasAncestorWithClipPath() 1396 && !layer->hasAncestorWithClipPath()
1390 && !layer->layoutObject()->style()->hasBorderRadius(); 1397 && !layer->layoutObject()->style()->hasBorderRadius();
1391 } 1398 }
1392 1399
1393 void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) 1400 void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode)
1394 { 1401 {
1395 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la yer()); 1402 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la yer());
1396 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) { 1403 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) {
1397 m_needsCompositedScrolling = needsCompositedScrolling; 1404 m_needsCompositedScrolling = needsCompositedScrolling;
1398 layer()->didUpdateNeedsCompositedScrolling(); 1405 layer()->didUpdateNeedsCompositedScrolling();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 } 1525 }
1519 1526
1520 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1527 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1521 { 1528 {
1522 visitor->trace(m_scrollableArea); 1529 visitor->trace(m_scrollableArea);
1523 visitor->trace(m_hBar); 1530 visitor->trace(m_hBar);
1524 visitor->trace(m_vBar); 1531 visitor->trace(m_vBar);
1525 } 1532 }
1526 1533
1527 } // namespace blink 1534 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698