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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Background phase 43 // Background phase
44 // 44 //
45 // Paint background of the current object and non-self-painting descendants. 45 // Paint background of the current object and non-self-painting descendants.
46 PaintPhaseBlockBackground = 0, 46 PaintPhaseBlockBackground = 0,
47 // 47 //
48 // The following two values are added besides the normal PaintPhaseBlockBack ground 48 // The following two values are added besides the normal PaintPhaseBlockBack ground
49 // to distinguish backgrounds for the object itself and for descendants, bec ause 49 // to distinguish backgrounds for the object itself and for descendants, bec ause
50 // the two backgrounds are often painted with different scroll offsets and c lips. 50 // the two backgrounds are often painted with different scroll offsets and c lips.
51 // 51 //
52 // Paint background of the current object only. 52 // Paint background of the current object only.
53 PaintPhaseSelfBlockBackground = 1, 53 PaintPhaseSelfBlockBackgroundOnly = 1,
54 // Paint backgrounds of non-self-painting descendants only. The painter shou ld call 54 // Paint backgrounds of non-self-painting descendants only. The painter shou ld call
55 // each non-self-painting child's paint method by passing paintInfo.forDesce ndants() which 55 // each non-self-painting child's paint method by passing paintInfo.forDesce ndants() which
56 // converts PaintPhaseDescendantsBlockBackgrounds to PaintPhaseBlockBackgrou nd. 56 // converts PaintPhaseDescendantsBlockBackgroundsOnly to PaintPhaseBlockBack ground.
57 PaintPhaseDescendantBlockBackgrounds = 2, 57 PaintPhaseDescendantBlockBackgroundsOnly = 2,
58 58
59 // Float phase 59 // Float phase
60 PaintPhaseFloat = 3, 60 PaintPhaseFloat = 3,
61 61
62 // Foreground phase 62 // Foreground phase
63 PaintPhaseForeground = 4, 63 PaintPhaseForeground = 4,
64 64
65 // Outline phase 65 // Outline phase
66 // 66 //
67 // Paint outline for the current object and non-self-painting descendants. 67 // Paint outline for the current object and non-self-painting descendants.
68 PaintPhaseOutline = 5, 68 PaintPhaseOutline = 5,
69 // 69 //
70 // Similar to the background phase, the following two values are added for p ainting 70 // Similar to the background phase, the following two values are added for p ainting
71 // outlines of the object itself and for descendants. 71 // outlines of the object itself and for descendants.
72 // 72 //
73 // Paint outline for the current object only. 73 // Paint outline for the current object only.
74 PaintPhaseSelfOutline = 6, 74 PaintPhaseSelfOutlineOnly = 6,
75 // Paint outlines of non-self-painting descendants only. The painter should call each 75 // Paint outlines of non-self-painting descendants only. The painter should call each
76 // non-self-painting child's paint method by passing paintInfo.forDescendant s() which 76 // non-self-painting child's paint method by passing paintInfo.forDescendant s() which
77 // converts PaintPhaseDescendantsOutliness to PaintPhaseBlockOutline. 77 // converts PaintPhaseDescendantsOutlinesOnly to PaintPhaseBlockOutline.
78 PaintPhaseDescendantOutlines = 7, 78 PaintPhaseDescendantOutlinesOnly = 7,
79 79
80 // The below are auxiliary phases which are used to paint special effects. 80 // The below are auxiliary phases which are used to paint special effects.
81 PaintPhaseSelection = 8, 81 PaintPhaseSelection = 8,
82 PaintPhaseTextClip = 9, 82 PaintPhaseTextClip = 9,
83 PaintPhaseMask = 10, 83 PaintPhaseMask = 10,
84 PaintPhaseClippingMask = 11, 84 PaintPhaseClippingMask = 11,
85 85
86 PaintPhaseMax = PaintPhaseClippingMask, 86 PaintPhaseMax = PaintPhaseClippingMask,
87 // These values must be kept in sync with DisplayItem::Type and DisplayItem: :typeAsDebugString(). 87 // These values must be kept in sync with DisplayItem::Type and DisplayItem: :typeAsDebugString().
88 }; 88 };
89 89
90 inline bool shouldPaintSelfBlockBackground(PaintPhase phase)
91 {
92 return phase == PaintPhaseBlockBackground || phase == PaintPhaseSelfBlockBac kgroundOnly;
93 }
94
95 inline bool shouldPaintSelfOutline(PaintPhase phase)
96 {
97 return phase == PaintPhaseOutline || phase == PaintPhaseSelfOutlineOnly;
98 }
99
100 inline bool shouldPaintDescendantBlockBackgrounds(PaintPhase phase)
101 {
102 return phase == PaintPhaseBlockBackground || phase == PaintPhaseDescendantBl ockBackgroundsOnly;
103 }
104
105 inline bool shouldPaintDescendantOutlines(PaintPhase phase)
106 {
107 return phase == PaintPhaseOutline || phase == PaintPhaseDescendantOutlinesOn ly;
108 }
109
90 // Those flags are meant as global tree operations. This means 110 // Those flags are meant as global tree operations. This means
91 // that they should be constant for a paint phase. 111 // that they should be constant for a paint phase.
92 enum GlobalPaintFlag { 112 enum GlobalPaintFlag {
93 GlobalPaintNormalPhase = 0, 113 GlobalPaintNormalPhase = 0,
94 // Used when painting selection as part of a drag-image. This 114 // Used when painting selection as part of a drag-image. This
95 // flag disables a lot of the painting code and specifically 115 // flag disables a lot of the painting code and specifically
96 // triggers a PaintPhaseSelection. 116 // triggers a PaintPhaseSelection.
97 GlobalPaintSelectionOnly = 1 << 0, 117 GlobalPaintSelectionOnly = 1 << 0,
98 // Used when painting a drag-image or printing in order to 118 // Used when painting a drag-image or printing in order to
99 // ignore the hardware layers and paint the whole tree 119 // ignore the hardware layers and paint the whole tree
100 // into the topmost layer. 120 // into the topmost layer.
101 GlobalPaintFlattenCompositingLayers = 1 << 1, 121 GlobalPaintFlattenCompositingLayers = 1 << 1,
102 // Used when printing in order to adapt the output to the medium, for 122 // Used when printing in order to adapt the output to the medium, for
103 // instance by not painting shadows and selections on text, and add 123 // instance by not painting shadows and selections on text, and add
104 // URL metadata for links. 124 // URL metadata for links.
105 GlobalPaintPrinting = 1 << 2 125 GlobalPaintPrinting = 1 << 2
106 }; 126 };
107 127
108 typedef unsigned GlobalPaintFlags; 128 typedef unsigned GlobalPaintFlags;
109 129
110 } // namespace blink 130 } // namespace blink
111 131
112 #endif // PaintPhase_h 132 #endif // PaintPhase_h
OLDNEW
« 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