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

Unified Diff: sky/engine/core/rendering/style/RenderStyle.cpp

Issue 851203003: Merge diffNeedsFullLayout methods. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/style/RenderStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/style/RenderStyle.cpp
diff --git a/sky/engine/core/rendering/style/RenderStyle.cpp b/sky/engine/core/rendering/style/RenderStyle.cpp
index 9c25b7a241cb9f9d458686c87b13a6eb6c51fdbd..b8588c9f51bed8442ef4cdfddbf6292f41dc0632 100644
--- a/sky/engine/core/rendering/style/RenderStyle.cpp
+++ b/sky/engine/core/rendering/style/RenderStyle.cpp
@@ -286,12 +286,9 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co
StyleDifference diff;
- // FIXME(sky): Combine these two into one function call.
- if (diffNeedsFullLayoutAndPaintInvalidation(other)
- || diffNeedsFullLayout(other))
+ if (diffNeedsFullLayout(other)) {
diff.setNeedsFullLayout();
-
- if (!diff.needsFullLayout() && position() != StaticPosition && surround->offset != other.surround->offset) {
+ } else if (position() != StaticPosition && surround->offset != other.surround->offset) {
// Optimize for the case where a positioned layer is moving but not changing size.
if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width()))
diff.setNeedsPositionedMovementLayout();
@@ -310,7 +307,7 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co
return diff;
}
-bool RenderStyle::diffNeedsFullLayoutAndPaintInvalidation(const RenderStyle& other) const
+bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const
{
// FIXME: Not all cases in this method need both full layout and paint invalidation.
// Should move cases into diffNeedsFullLayout() if
@@ -422,13 +419,6 @@ bool RenderStyle::diffNeedsFullLayoutAndPaintInvalidation(const RenderStyle& oth
return true;
}
- // Movement of non-static-positioned object is special cased in RenderStyle::visualInvalidationDiff().
-
- return false;
-}
-
-bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const
-{
if (m_box.get() != other.m_box.get()) {
if (m_box->width() != other.m_box->width()
|| m_box->minWidth() != other.m_box->minWidth()
@@ -456,6 +446,8 @@ bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const
return true;
}
+ // Movement of non-static-positioned object is special cased in RenderStyle::visualInvalidationDiff().
+
return false;
}
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698