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

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: Fix date (for real this time) 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..b13cbd796a8108912f90fb7256e92716e1f9dccc 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1494,13 +1494,23 @@ 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()->style()->hasBorderDecoration()
+ // (missing background behind dashed borders). Resolve this case, 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