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

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

Issue 2259493004: Fix Compositing of Opaque Scrolling Layers and Add Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert unnecessary change. Created 4 years, 3 months 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@gmail.com> 9 * Christian Biesinger <cbiesinger@gmail.com>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 return false; 1495 return false;
1496 1496
1497 Node* node = layer->enclosingNode(); 1497 Node* node = layer->enclosingNode();
1498 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp erties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::k ScrollLeft))) 1498 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp erties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::k ScrollLeft)))
1499 return true; 1499 return true;
1500 1500
1501 // TODO(schenney) The color test alone is inadequate. When https://coderevie w.chromium.org/2196583002 lands 1501 // TODO(schenney) The color test alone is inadequate. When https://coderevie w.chromium.org/2196583002 lands
1502 // we should use PaintLayer::shouldPaintBackgroundOntoForeground() because w e will not still get 1502 // we should use PaintLayer::shouldPaintBackgroundOntoForeground() because w e will not still get
1503 // LCD text unless the conditions there are met. It also unifies logic for s crolling compositing decisions. 1503 // LCD text unless the conditions there are met. It also unifies logic for s crolling compositing decisions.
1504 bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScro llersEnabled() 1504 bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScro llersEnabled()
1505 && !layer->layoutObject()->style()->visitedDependentColor(CSSPropertyBac kgroundColor).hasAlpha(); 1505 && layer->shouldPaintBackgroundOntoScrollingContentsLayer()
Stephen Chennney 2016/08/26 18:01:41 My understanding is that here we cannot use the Co
flackr 2016/08/26 18:24:23 I believe that's correct - but should be easy to t
Stephen Chennney 2016/08/26 18:42:08 I'll check.
1506 && layer->backgroundIsKnownToBeOpaqueInRect(toLayoutBox(layer->layoutObj ect())->paddingBoxRect());
Stephen Chennney 2016/08/26 20:46:01 We have a chicken and egg problem. The first thing
1506 if (mode == PaintLayerScrollableArea::ConsiderLCDText 1507 if (mode == PaintLayerScrollableArea::ConsiderLCDText
1507 && !layer->compositor()->preferCompositingToLCDTextEnabled() 1508 && !layer->compositor()->preferCompositingToLCDTextEnabled()
1508 && !backgroundSupportsLCDText) 1509 && !backgroundSupportsLCDText)
1509 return false; 1510 return false;
1510 1511
1511 // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject() ->style()->hasBorderDecoration() 1512 // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject() ->style()->hasBorderDecoration()
1512 // (missing background behind dashed borders). Resolve this case, or not, an d update this check with 1513 // (missing background behind dashed borders). Resolve this case, or not, an d update this check with
1513 // the results. 1514 // the results.
1514 return !(layer->size().isEmpty() 1515 return !(layer->size().isEmpty()
1515 || layer->hasDescendantWithClipPath() 1516 || layer->hasDescendantWithClipPath()
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1773
1773 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as() 1774 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as()
1774 { 1775 {
1775 for (auto& scrollableArea : *s_needsClamp) 1776 for (auto& scrollableArea : *s_needsClamp)
1776 scrollableArea->clampScrollPositionsAfterLayout(); 1777 scrollableArea->clampScrollPositionsAfterLayout();
1777 delete s_needsClamp; 1778 delete s_needsClamp;
1778 s_needsClamp = nullptr; 1779 s_needsClamp = nullptr;
1779 } 1780 }
1780 1781
1781 } // namespace blink 1782 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698