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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1826013002: Enable compositing for opaque scrolling content on low DPI screens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test and TODO for failure mode Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index cb5500a93959ed72957af3adadf0b1c9d534d3bc..9f44412cbe23d36e07160bef6283872b60cecfa2 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1494,13 +1494,24 @@ static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode
if (node && node->isElementNode() && (toElement(node)->compositorMutableProperties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::kScrollLeft)))
return true;
- if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor()->preferCompositingToLCDTextEnabled())
+ // TODO(schenney) The color test alone is inadequate. When https://codereview.chromium.org/2196583002 lands
+ // we should use PaintLayer::shouldPaintBackgroundOntoForeground() because we will not still get
+ // LCD text unless the conditions there are met. It also unifies logic for scrolling compositing
+ // decisions.
+ bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled()
+ && !layer->layoutObject()->style()->visitedDependentColor(CSSPropertyBackgroundColor).hasAlpha();
+ if (mode == PaintLayerScrollableArea::ConsiderLCDText
+ && !layer->compositor()->preferCompositingToLCDTextEnabled()
+ && !backgroundSupportsLCDText)
return false;
- return !layer->size().isEmpty()
- && !layer->hasDescendantWithClipPath()
- && !layer->hasAncestorWithClipPath()
- && !layer->layoutObject()->style()->hasBorderRadius();
+ // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject()->isFloating() (asserts) and
chrishtr 2016/08/04 16:35:44 isFloating should have been fixed by https://coder
Stephen Chennney 2016/08/04 17:35:25 Yep. Forgot you fixed that.
+ // layer->layoutObject()->style()->hasBorderDecoration() (missing background behind dashed borders).
+ // Resolve these cases, or not, and update this check with the results.
+ return !(layer->size().isEmpty()
+ || layer->hasDescendantWithClipPath()
+ || layer->hasAncestorWithClipPath()
+ || layer->layoutObject()->style()->hasBorderRadius());
}
void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode)

Powered by Google App Engine
This is Rietveld 408576698