| OLD | NEW |
| 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 |
| 7 * reserved. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * | 9 * |
| 9 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 11 * modify it under the terms of the GNU Library General Public |
| 11 * License as published by the Free Software Foundation; either | 12 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 13 * version 2 of the License, or (at your option) any later version. |
| 13 * | 14 * |
| 14 * This library is distributed in the hope that it will be useful, | 15 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 18 * Library General Public License for more details. |
| 18 * | 19 * |
| 19 * You should have received a copy of the GNU Library General Public License | 20 * You should have received a copy of the GNU Library General Public License |
| 20 * along with this library; see the file COPYING.LIB. If not, write to | 21 * along with this library; see the file COPYING.LIB. If not, write to |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
| 23 * | 24 * |
| 24 */ | 25 */ |
| 25 | 26 |
| 26 #ifndef PaintPhase_h | 27 #ifndef PaintPhase_h |
| 27 #define PaintPhase_h | 28 #define PaintPhase_h |
| 28 | 29 |
| 29 namespace blink { | 30 namespace blink { |
| 30 | 31 |
| 31 // The painting of a layer occurs in 4 phases, Each involves a recursive descen
t | 32 // The painting of a layer occurs in 4 phases, Each involves a recursive |
| 32 // into the layer's layout objects in painting order: | 33 // descent into the layer's layout objects in painting order: |
| 33 // 1. Background phase: backgrounds and borders of all blocks are painted. | 34 // 1. Background phase: backgrounds and borders of all blocks are painted. |
| 34 // Inlines are not painted at all. | 35 // Inlines are not painted at all. |
| 35 // 2. Float phase: floating objects are painted above block backgrounds but ent
irely | 36 // 2. Float phase: floating objects are painted above block backgrounds but |
| 36 // below inline content that can overlap them. | 37 // entirely below inline content that can overlap them. |
| 37 // 3. Foreground phase: all inlines are fully painted. Atomic inline elements w
ill | 38 // 3. Foreground phase: all inlines are fully painted. Atomic inline elements |
| 38 // get all 4 phases invoked on them during this phase, as if they were stack
ing | 39 // will get all 4 phases invoked on them during this phase, as if they were |
| 39 // contexts (see ObjectPainter::paintAllPhasesAtomically()). | 40 // stacking contexts (see ObjectPainter::paintAllPhasesAtomically()). |
| 40 // 4. Outline phase: outlines are painted over the foreground. | 41 // 4. Outline phase: outlines are painted over the foreground. |
| 41 | 42 |
| 42 enum PaintPhase { | 43 enum PaintPhase { |
| 43 // Background phase | 44 // Background phase |
| 44 // | 45 // |
| 45 // Paint background of the current object and non-self-painting descendants. | 46 // Paint background of the current object and non-self-painting descendants. |
| 46 PaintPhaseBlockBackground = 0, | 47 PaintPhaseBlockBackground = 0, |
| 47 // | 48 // |
| 48 // The following two values are added besides the normal PaintPhaseBlockBackgr
ound | 49 // The following two values are added besides the normal |
| 49 // to distinguish backgrounds for the object itself and for descendants, becau
se | 50 // PaintPhaseBlockBackground to distinguish backgrounds for the object itself |
| 50 // the two backgrounds are often painted with different scroll offsets and cli
ps. | 51 // and for descendants, because the two backgrounds are often painted with |
| 52 // different scroll offsets and clips. |
| 51 // | 53 // |
| 52 // Paint background of the current object only. | 54 // Paint background of the current object only. |
| 53 PaintPhaseSelfBlockBackgroundOnly = 1, | 55 PaintPhaseSelfBlockBackgroundOnly = 1, |
| 54 // Paint backgrounds of non-self-painting descendants only. The painter should
call | 56 // Paint backgrounds of non-self-painting descendants only. The painter should |
| 55 // each non-self-painting child's paint method by passing paintInfo.forDescend
ants() which | 57 // call each non-self-painting child's paint method by passing |
| 56 // converts PaintPhaseDescendantsBlockBackgroundsOnly to PaintPhaseBlockBackgr
ound. | 58 // paintInfo.forDescendants() which converts |
| 59 // PaintPhaseDescendantsBlockBackgroundsOnly to PaintPhaseBlockBackground. |
| 57 PaintPhaseDescendantBlockBackgroundsOnly = 2, | 60 PaintPhaseDescendantBlockBackgroundsOnly = 2, |
| 58 | 61 |
| 59 // Float phase | 62 // Float phase |
| 60 PaintPhaseFloat = 3, | 63 PaintPhaseFloat = 3, |
| 61 | 64 |
| 62 // Foreground phase | 65 // Foreground phase |
| 63 PaintPhaseForeground = 4, | 66 PaintPhaseForeground = 4, |
| 64 | 67 |
| 65 // Outline phase | 68 // Outline phase |
| 66 // | 69 // |
| 67 // Paint outline for the current object and non-self-painting descendants. | 70 // Paint outline for the current object and non-self-painting descendants. |
| 68 PaintPhaseOutline = 5, | 71 PaintPhaseOutline = 5, |
| 69 // | 72 // |
| 70 // Similar to the background phase, the following two values are added for pai
nting | 73 // Similar to the background phase, the following two values are added for |
| 71 // outlines of the object itself and for descendants. | 74 // painting outlines of the object itself and for descendants. |
| 72 // | 75 // |
| 73 // Paint outline for the current object only. | 76 // Paint outline for the current object only. |
| 74 PaintPhaseSelfOutlineOnly = 6, | 77 PaintPhaseSelfOutlineOnly = 6, |
| 75 // Paint outlines of non-self-painting descendants only. The painter should ca
ll each | 78 // Paint outlines of non-self-painting descendants only. The painter should |
| 76 // non-self-painting child's paint method by passing paintInfo.forDescendants(
) which | 79 // call each non-self-painting child's paint method by passing |
| 80 // paintInfo.forDescendants() which |
| 77 // converts PaintPhaseDescendantsOutlinesOnly to PaintPhaseBlockOutline. | 81 // converts PaintPhaseDescendantsOutlinesOnly to PaintPhaseBlockOutline. |
| 78 PaintPhaseDescendantOutlinesOnly = 7, | 82 PaintPhaseDescendantOutlinesOnly = 7, |
| 79 | 83 |
| 80 // The below are auxiliary phases which are used to paint special effects. | 84 // The below are auxiliary phases which are used to paint special effects. |
| 81 PaintPhaseSelection = 8, | 85 PaintPhaseSelection = 8, |
| 82 PaintPhaseTextClip = 9, | 86 PaintPhaseTextClip = 9, |
| 83 PaintPhaseMask = 10, | 87 PaintPhaseMask = 10, |
| 84 PaintPhaseClippingMask = 11, | 88 PaintPhaseClippingMask = 11, |
| 85 | 89 |
| 86 PaintPhaseMax = PaintPhaseClippingMask, | 90 PaintPhaseMax = PaintPhaseClippingMask, |
| 87 // These values must be kept in sync with DisplayItem::Type and DisplayItem::t
ypeAsDebugString(). | 91 // These values must be kept in sync with DisplayItem::Type and |
| 92 // DisplayItem::typeAsDebugString(). |
| 88 }; | 93 }; |
| 89 | 94 |
| 90 inline bool shouldPaintSelfBlockBackground(PaintPhase phase) { | 95 inline bool shouldPaintSelfBlockBackground(PaintPhase phase) { |
| 91 return phase == PaintPhaseBlockBackground || | 96 return phase == PaintPhaseBlockBackground || |
| 92 phase == PaintPhaseSelfBlockBackgroundOnly; | 97 phase == PaintPhaseSelfBlockBackgroundOnly; |
| 93 } | 98 } |
| 94 | 99 |
| 95 inline bool shouldPaintSelfOutline(PaintPhase phase) { | 100 inline bool shouldPaintSelfOutline(PaintPhase phase) { |
| 96 return phase == PaintPhaseOutline || phase == PaintPhaseSelfOutlineOnly; | 101 return phase == PaintPhaseOutline || phase == PaintPhaseSelfOutlineOnly; |
| 97 } | 102 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 122 // instance by not painting shadows and selections on text, and add | 127 // instance by not painting shadows and selections on text, and add |
| 123 // URL metadata for links. | 128 // URL metadata for links. |
| 124 GlobalPaintPrinting = 1 << 2 | 129 GlobalPaintPrinting = 1 << 2 |
| 125 }; | 130 }; |
| 126 | 131 |
| 127 typedef unsigned GlobalPaintFlags; | 132 typedef unsigned GlobalPaintFlags; |
| 128 | 133 |
| 129 } // namespace blink | 134 } // namespace blink |
| 130 | 135 |
| 131 #endif // PaintPhase_h | 136 #endif // PaintPhase_h |
| OLD | NEW |