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

Unified Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 851033002: Simplify the paint invalidation bits. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: add one more check Created 5 years, 11 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 | « sky/engine/core/rendering/RenderLayerModelObject.cpp ('k') | sky/engine/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderObject.cpp
diff --git a/sky/engine/core/rendering/RenderObject.cpp b/sky/engine/core/rendering/RenderObject.cpp
index 67626e7434aef20a824d508c279455c47dfe8b03..53dd7c2c0a687a4d1561e88b6efb2cfd8d4ecbab 100644
--- a/sky/engine/core/rendering/RenderObject.cpp
+++ b/sky/engine/core/rendering/RenderObject.cpp
@@ -1199,30 +1199,18 @@ void RenderObject::selectionStartEnd(int& spos, int& epos) const
StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const
{
- // If transform changed, and the layer does not paint into its own separate backing, then we need to invalidate paints.
- if (diff.transformChanged()) {
- // Text nodes share style with their parents but transforms don't apply to them,
- // hence the !isText() check.
- if (!isText())
- diff.setNeedsPaintInvalidationLayer();
+ // If transform, opacity or zIndex changed, then we need to invalidate paints.
+ // Text nodes share style with their parents but transform/opacity/z-index don't apply to them,
+ if (!isText() &&
+ (diff.transformChanged() || diff.opacityChanged() || diff.zIndexChanged())) {
+ diff.setNeedsPaintInvalidation();
}
- // If opacity or zIndex changed, and the layer does not paint into its own separate backing, then we need to invalidate paints (also
- // ignoring text nodes)
- if (diff.opacityChanged() || diff.zIndexChanged()) {
- if (!isText())
- diff.setNeedsPaintInvalidationLayer();
- }
-
- // If filter changed, and the layer does not paint into its own separate backing or it paints with filters, then we need to invalidate paints.
+ // If filter changed and it paints with filters, then we need to invalidate paints.
if (diff.filterChanged() && hasLayer()) {
- diff.setNeedsPaintInvalidationLayer();
+ diff.setNeedsPaintInvalidation();
}
- if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()
- && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor())
- diff.setNeedsPaintInvalidationObject();
-
// The answer to layerTypeRequired() for plugins, iframes, and canvas can change without the actual
// style changing, since it depends on whether we decide to composite these elements. When the
// layer status of one of these elements changes, we need to force a layout.
@@ -1232,12 +1220,6 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const
diff.setNeedsFullLayout();
}
- // If we have no layer(), just treat a PaintInvalidationLayer hint as a normal paint invalidation.
- if (diff.needsPaintInvalidationLayer() && !hasLayer()) {
- diff.clearNeedsPaintInvalidation();
- diff.setNeedsPaintInvalidationObject();
- }
-
return diff;
}
« no previous file with comments | « sky/engine/core/rendering/RenderLayerModelObject.cpp ('k') | sky/engine/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698