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

Unified Diff: sky/engine/core/rendering/style/StyleDifference.h

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/style/RenderStyle.cpp ('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/StyleDifference.h
diff --git a/sky/engine/core/rendering/style/StyleDifference.h b/sky/engine/core/rendering/style/StyleDifference.h
index 6a9ff936d14c5d86294b06595228f4704cea8afa..eb9be49ba24f8e70876ac2e3595187a11a542c8b 100644
--- a/sky/engine/core/rendering/style/StyleDifference.h
+++ b/sky/engine/core/rendering/style/StyleDifference.h
@@ -16,38 +16,20 @@ public:
OpacityChanged = 1 << 1,
ZIndexChanged = 1 << 2,
FilterChanged = 1 << 3,
- // The object needs to issue paint invalidations if it contains text or properties dependent on color (e.g., border or outline).
- TextOrColorChanged = 1 << 4,
};
StyleDifference()
- : m_paintInvalidationType(NoPaintInvalidation)
+ : m_needsPaintInvalidation(false)
, m_layoutType(NoLayout)
, m_propertySpecificDifferences(0)
{ }
- bool hasDifference() const { return m_paintInvalidationType || m_layoutType || m_propertySpecificDifferences; }
-
- bool hasAtMostPropertySpecificDifferences(unsigned propertyDifferences) const
- {
- return !m_paintInvalidationType && !m_layoutType && !(m_propertySpecificDifferences & ~propertyDifferences);
- }
-
- bool needsPaintInvalidation() const { return m_paintInvalidationType != NoPaintInvalidation; }
- void clearNeedsPaintInvalidation() { m_paintInvalidationType = NoPaintInvalidation; }
-
- // The object just needs to issue paint invalidations.
- bool needsPaintInvalidationObject() const { return m_paintInvalidationType == PaintInvalidationObject; }
- void setNeedsPaintInvalidationObject()
+ bool needsPaintInvalidation() const { return m_needsPaintInvalidation; }
+ void setNeedsPaintInvalidation()
{
- ASSERT(!needsPaintInvalidationLayer());
- m_paintInvalidationType = PaintInvalidationObject;
+ m_needsPaintInvalidation = true;
}
- // The layer and its descendant layers need to issue paint invalidations.
- bool needsPaintInvalidationLayer() const { return m_paintInvalidationType == PaintInvalidationLayer; }
- void setNeedsPaintInvalidationLayer() { m_paintInvalidationType = PaintInvalidationLayer; }
-
bool needsLayout() const { return m_layoutType != NoLayout; }
void clearNeedsLayout() { m_layoutType = NoLayout; }
@@ -74,16 +56,8 @@ public:
bool filterChanged() const { return m_propertySpecificDifferences & FilterChanged; }
void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; }
- bool textOrColorChanged() const { return m_propertySpecificDifferences & TextOrColorChanged; }
- void setTextOrColorChanged() { m_propertySpecificDifferences |= TextOrColorChanged; }
-
private:
- enum PaintInvalidationType {
- NoPaintInvalidation = 0,
- PaintInvalidationObject,
- PaintInvalidationLayer
- };
- unsigned m_paintInvalidationType : 2;
+ unsigned m_needsPaintInvalidation : 1;
enum LayoutType {
NoLayout = 0,
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698