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

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: Rebase 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
Index: Source/core/rendering/style/StyleDifference.h
diff --git a/Source/core/rendering/style/StyleDifference.h b/Source/core/rendering/style/StyleDifference.h
index 2d1e19c145d626f7fae065fec3300589e4afe250..9e23f3056fc642508efb1b094f183c45d3d7f236 100644
--- a/Source/core/rendering/style/StyleDifference.h
+++ b/Source/core/rendering/style/StyleDifference.h
@@ -8,10 +8,13 @@
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
+//
+// Only directly needed actions are included. Indirect needed actions, such as
+// repaint caused by a layout change, are not included.
class StyleDifference {
public:
StyleDifference()
@@ -30,11 +33,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;
+ m_repaintType = RepaintObject;
}
// The layer and its descendant layers need to be repainted.
@@ -50,8 +53,6 @@ public:
{
if (!needsFullLayout())
m_layoutType |= PositionedMovement;
- // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior.
- m_repaintType = NoRepaint;
}
// Only overflow needs to be recomputed.
@@ -60,24 +61,17 @@ public:
{
if (!needsFullLayout())
m_layoutType |= SimplifiedLayout;
- // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior.
- m_repaintType = NoRepaint;
}
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;

Powered by Google App Engine
This is Rietveld 408576698