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

Unified Diff: Source/core/layout/compositing/CompositingReasonFinder.cpp

Issue 1298493003: Currently we only composite fixed position elements if we are on High DPI devices. This fix allows … Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/compositing/CompositingReasonFinder.cpp
diff --git a/Source/core/layout/compositing/CompositingReasonFinder.cpp b/Source/core/layout/compositing/CompositingReasonFinder.cpp
index 872073d7418ac37fd9f1e91434c25268fd0d3432..a9eea942165e36647f31a79e93a217999b22aac1 100644
--- a/Source/core/layout/compositing/CompositingReasonFinder.cpp
+++ b/Source/core/layout/compositing/CompositingReasonFinder.cpp
@@ -176,11 +176,18 @@ bool CompositingReasonFinder::requiresCompositingForAnimation(const ComputedStyl
bool CompositingReasonFinder::requiresCompositingForPositionFixed(const DeprecatedPaintLayer* layer) const
{
- if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger))
- return false;
// Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements.
// They will stay fixed wrt the container rather than the enclosing frame.
- return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollable();
+ if (!layer->scrollsWithViewport() || !m_layoutView.frameView()->isScrollable())
+ return false;
+
+ if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) {
trchen 2015/08/14 21:02:17 Please swap the branches. Avoid negative predicate
+ // If the layer is opaque we can still promote it since we will not lose LCD text
+ LayoutRect bounds = layer->layoutBox()->contentBoxRect();
trchen 2015/08/14 21:02:17 This doesn't look right because texts can overflow
+ return layer->backgroundIsKnownToBeOpaqueInRect(bounds);
+ }
+
+ return true;
}
}
« no previous file with comments | « no previous file | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698