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

Unified 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: Fix comment. 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 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 4a3d4a54238540f1a60f17931b90eb4a17fbbb44..f3710f0d20314c96e033feab385d84e7201682cc 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1493,11 +1493,12 @@ static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode
if (node && node->isElementNode() && (toElement(node)->compositorMutableProperties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::kScrollLeft)))
return true;
- // 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.
+ // TODO(schenney): LCD Text also requires integer scroll offsets for the layer. While we
+ // use integer scroll offsets locally when !layer->compositor()->preferCompositingToLCDTextEnabled(),
+ // we do not check offsets accumulated from the root (including translates). crbug.com/644833
bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled()
- && !layer->layoutObject()->style()->visitedDependentColor(CSSPropertyBackgroundColor).hasAlpha();
+ && layer->shouldPaintBackgroundOntoScrollingContentsLayer()
+ && layer->backgroundIsKnownToBeOpaqueInRect(toLayoutBox(layer->layoutObject())->paddingBoxRect());
if (mode == PaintLayerScrollableArea::ConsiderLCDText
&& !layer->compositor()->preferCompositingToLCDTextEnabled()
&& !backgroundSupportsLCDText)

Powered by Google App Engine
This is Rietveld 408576698