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

Unified Diff: Source/core/rendering/style/StyleDifference.h

Issue 247713003: Separate repaint and layout requirements of StyleDifference (Step 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments; Rebase on RAL Created 6 years, 8 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 | « Source/core/rendering/style/SVGRenderStyle.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/StyleDifference.h
diff --git a/Source/core/rendering/style/StyleDifference.h b/Source/core/rendering/style/StyleDifference.h
index dac2899d04470a1b6f97f9b08a6dc40b449d8a8a..d8418217b83d1c2df5ea89799ae9f084854fa04b 100644
--- a/Source/core/rendering/style/StyleDifference.h
+++ b/Source/core/rendering/style/StyleDifference.h
@@ -5,13 +5,15 @@
#ifndef StyleDifference_h
#define StyleDifference_h
+#include "wtf/Assertions.h"
+
namespace WebCore {
// This class represents the difference between two computed styles (RenderStyle).
-// The difference can be of 3 types:
-// - Layout difference
-// - Repaint difference
-// - Recompositing difference
+// The difference can be combination of 3 types according to the actions needed:
+// - Difference needing layout
+// - Difference needing repaint
+// - Difference needing recompositing layers
class StyleDifference {
public:
StyleDifference()
@@ -30,11 +32,11 @@ public:
void clearNeedsRepaint() { m_repaintType = NoRepaint; }
// The object just needs to be repainted.
- bool needsRepaintObjectOnly() const { return m_repaintType == RepaintObjectOnly; }
+ bool needsRepaintObject() const { return m_repaintType == RepaintObject; }
void setNeedsRepaintObject()
{
- if (!needsRepaintLayer())
- m_repaintType = RepaintObjectOnly;
+ ASSERT(!needsRepaintLayer());
+ m_repaintType = RepaintObject;
}
// The layer and its descendant layers need to be repainted.
@@ -45,37 +47,30 @@ public:
void clearNeedsLayout() { m_layoutType = NoLayout; }
// The offset of this positioned object has been updated.
- bool needsPositionedMovementLayout() const { return m_layoutType & PositionedMovement; }
+ bool needsPositionedMovementLayout() const { return m_layoutType == PositionedMovement; }
void setNeedsPositionedMovementLayout()
{
- if (!needsFullLayout())
- m_layoutType |= PositionedMovement;
- // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior.
- m_repaintType = NoRepaint;
+ ASSERT(!needsFullLayout());
+ m_layoutType = PositionedMovement;
}
bool needsFullLayout() const { return m_layoutType == FullLayout; }
- void setNeedsFullLayout()
- {
- m_layoutType = FullLayout;
- // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior.
- m_repaintType = NoRepaint;
- }
+ void setNeedsFullLayout() { m_layoutType = FullLayout; }
private:
unsigned m_needsRecompositeLayer : 1;
enum RepaintType {
NoRepaint = 0,
- RepaintObjectOnly,
+ RepaintObject,
RepaintLayer
};
unsigned m_repaintType : 2;
enum LayoutType {
NoLayout = 0,
- PositionedMovement = 1 << 0,
- FullLayout = 1 << 1
+ PositionedMovement,
+ FullLayout
};
unsigned m_layoutType : 2;
};
« no previous file with comments | « Source/core/rendering/style/SVGRenderStyle.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698