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

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: Layout test update && bug fix Created 3 years, 9 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..79f55aebac9e705df76d850fb57b51ec7cc877a8 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
@@ -154,6 +154,12 @@ class CompositingRequirementsUpdater::RecursionData {
bool m_hasUnisolatedCompositedBlendingDescendant;
bool m_testingOverlap;
bool m_hasCompositedScrollingAncestor;
+ Vector<PaintLayer*>& layersNeedingPostProcessing() {
+ return m_layersNeedingPostProcessing;
+ }
+
+ private:
+ Vector<PaintLayer*> m_layersNeedingPostProcessing;
};
static bool requiresCompositingOrSquashing(CompositingReasons reasons) {
@@ -517,6 +523,35 @@ void CompositingRequirementsUpdater::updateRecursive(
if (willBeCompositedOrSquashed)
currentRecursionData.m_subtreeIsCompositing = true;
+ // Track non-composited skewed elements
+ if (!willBeCompositedOrSquashed && canBeComposited &&
+ layer->layoutObject().styleRef().hasTransform() &&
+ layer->layoutObject().styleRef().transform().hasSkew()) {
+ currentRecursionData.layersNeedingPostProcessing().push_back(layer);
+ }
+
+ // Promote skewed elements within a promoted skewed element to improve
+ // output quality.
+ if (willBeCompositedOrSquashed &&
+ !childRecursionData.layersNeedingPostProcessing().isEmpty()) {
+ // If an skewed element is composited due to its descendants, we have to
+ // update the uncomposited skewed descendants to composite them.
+ if (layer->layoutObject().styleRef().hasTransform() &&
+ layer->layoutObject().styleRef().transform().hasSkew()) {
+ for (auto& childLayer :
+ childRecursionData.layersNeedingPostProcessing()) {
+ childLayer->setCompositingReasons(
+ CompositingReasonSkewWithCompositedSkewedAncestor);
+ }
+ }
+ childRecursionData.layersNeedingPostProcessing().clear();
+ }
+
+ // Current non-leaf layer and it descendants have been updated.
+ if (layer->firstChild()) {
+ currentRecursionData.layersNeedingPostProcessing().clear();
+ }
+
// 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