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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPhase.h

Issue 1584903002: Improvement handling of background and outline paint phases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintPhaseRename
Patch Set: Created 4 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
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 {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | third_party/WebKit/Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698