Index: third_party/WebKit/Source/core/paint/PaintPhase.h |
diff --git a/third_party/WebKit/Source/core/paint/PaintPhase.h b/third_party/WebKit/Source/core/paint/PaintPhase.h |
index 2c43af8cf514f6c942b1d86a1333ab67701d9f2b..eaf705077737f20d6335a54b26d8891e072bca4c 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintPhase.h |
+++ b/third_party/WebKit/Source/core/paint/PaintPhase.h |
@@ -50,11 +50,11 @@ enum PaintPhase { |
// the two backgrounds are often painted with different scroll offsets and clips. |
// |
// Paint background of the current object only. |
- PaintPhaseSelfBlockBackground = 1, |
+ PaintPhaseSelfBlockBackgroundOnly = 1, |
// Paint backgrounds of non-self-painting descendants only. The painter should call |
// each non-self-painting child's paint method by passing paintInfo.forDescendants() which |
- // converts PaintPhaseDescendantsBlockBackgrounds to PaintPhaseBlockBackground. |
- PaintPhaseDescendantBlockBackgrounds = 2, |
+ // converts PaintPhaseDescendantsBlockBackgroundsOnly to PaintPhaseBlockBackground. |
+ PaintPhaseDescendantBlockBackgroundsOnly = 2, |
// Float phase |
PaintPhaseFloat = 3, |
@@ -71,11 +71,11 @@ enum PaintPhase { |
// outlines of the object itself and for descendants. |
// |
// Paint outline for the current object only. |
- PaintPhaseSelfOutline = 6, |
+ PaintPhaseSelfOutlineOnly = 6, |
// Paint outlines of non-self-painting descendants only. The painter should call each |
// non-self-painting child's paint method by passing paintInfo.forDescendants() which |
- // converts PaintPhaseDescendantsOutliness to PaintPhaseBlockOutline. |
- PaintPhaseDescendantOutlines = 7, |
+ // converts PaintPhaseDescendantsOutlinesOnly to PaintPhaseBlockOutline. |
+ PaintPhaseDescendantOutlinesOnly = 7, |
// The below are auxiliary phases which are used to paint special effects. |
PaintPhaseSelection = 8, |
@@ -87,6 +87,26 @@ enum PaintPhase { |
// These values must be kept in sync with DisplayItem::Type and DisplayItem::typeAsDebugString(). |
}; |
+inline bool shouldPaintSelfBlockBackground(PaintPhase phase) |
+{ |
+ return phase == PaintPhaseBlockBackground || phase == PaintPhaseSelfBlockBackgroundOnly; |
+} |
+ |
+inline bool shouldPaintSelfOutline(PaintPhase phase) |
+{ |
+ return phase == PaintPhaseOutline || phase == PaintPhaseSelfOutlineOnly; |
+} |
+ |
+inline bool shouldPaintDescendantBlockBackgrounds(PaintPhase phase) |
+{ |
+ return phase == PaintPhaseBlockBackground || phase == PaintPhaseDescendantBlockBackgroundsOnly; |
+} |
+ |
+inline bool shouldPaintDescendantOutlines(PaintPhase phase) |
+{ |
+ return phase == PaintPhaseOutline || phase == PaintPhaseDescendantOutlinesOnly; |
+} |
+ |
// Those flags are meant as global tree operations. This means |
// that they should be constant for a paint phase. |
enum GlobalPaintFlag { |