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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp

Issue 2714283002: Fix unexpected blurry text caused by combination of skew and promotion (Closed)
Patch Set: Refactor && add unit tests Created 3 years, 10 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/layout/compositing/CompositingRequirementsUpdater.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
index aca28342b55b0d8d63095c2406bf06611a14e85a..b379b908560023c15087ccd1485e6e002dc0f1b8 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
@@ -147,13 +147,15 @@ class CompositingRequirementsUpdater::RecursionData {
m_subtreeIsCompositing(false),
m_hasUnisolatedCompositedBlendingDescendant(false),
m_testingOverlap(true),
- m_hasCompositedScrollingAncestor(false) {}
+ m_hasCompositedScrollingAncestor(false),
+ m_hasCompositedSkewedAncestor(false) {}
PaintLayer* m_compositingAncestor;
bool m_subtreeIsCompositing;
bool m_hasUnisolatedCompositedBlendingDescendant;
bool m_testingOverlap;
bool m_hasCompositedScrollingAncestor;
+ bool m_hasCompositedSkewedAncestor;
};
static bool requiresCompositingOrSquashing(CompositingReasons reasons) {
@@ -517,6 +519,36 @@ void CompositingRequirementsUpdater::updateRecursive(
if (willBeCompositedOrSquashed)
currentRecursionData.m_subtreeIsCompositing = true;
+ // If an skewed element is composited due to its descendants, we have to
flackr 2017/02/28 21:40:14 We want the opposite behavior, the descendant shou
+ // update the uncomposited skewed descendants to composite them.
+ if (currentRecursionData.m_subtreeIsCompositing &&
+ layer->layoutObject().styleRef().hasTransform() &&
+ layer->layoutObject().styleRef().transform().hasSkew()) {
+ childRecursionData.m_hasCompositedSkewedAncestor = true;
+
+ PaintLayerStackingNodeIterator iterator(
+ *layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
+ while (PaintLayerStackingNode* curNode = iterator.next()) {
+ IntRect absoluteChildDescendantBoundingBox;
+ updateRecursive(layer, curNode->layer(), overlapMap, childRecursionData,
+ anyDescendantHas3DTransform, unclippedDescendants,
+ absoluteChildDescendantBoundingBox);
+ absoluteDescendantBoundingBox.unite(absoluteChildDescendantBoundingBox);
+ }
+ }
+
+ // Promote skewed elements within a promoted skewed element to improve
+ // output quality.
+ if (canBeComposited && !willBeCompositedOrSquashed &&
+ currentRecursionData.m_hasCompositedSkewedAncestor) {
+ if (layer->layoutObject().styleRef().hasTransform()) {
+ if (layer->layoutObject().styleRef().transform().hasSkew()) {
+ reasonsToComposite |=
+ CompositingReasonSkewWithCompositedSkewedAncestor;
+ }
+ }
+ }
+
// Turn overlap testing off for later layers if it's already off, or if we
// have an animating transform. Note that if the layer clips its
// descendants, there's no reason to propagate the child animation to the

Powered by Google App Engine
This is Rietveld 408576698