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 PaintInfo_h | 27 #ifndef PaintInfo_h |
27 #define PaintInfo_h | 28 #define PaintInfo_h |
28 | 29 |
29 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
30 // TODO(jchaffraix): Once we unify PaintBehavior and PaintLayerFlags, we should
move | 31 // TODO(jchaffraix): Once we unify PaintBehavior and PaintLayerFlags, we should |
31 // PaintLayerFlags to PaintPhase and rename it. Thus removing the need for this
#include.#include "core/paint/PaintLayerPaintingInfo.h" | 32 // move PaintLayerFlags to PaintPhase and rename it. Thus removing the need for |
| 33 // this #include "core/paint/PaintLayerPaintingInfo.h" |
32 #include "core/paint/PaintLayerPaintingInfo.h" | 34 #include "core/paint/PaintLayerPaintingInfo.h" |
33 #include "core/paint/PaintPhase.h" | 35 #include "core/paint/PaintPhase.h" |
34 #include "platform/geometry/IntRect.h" | 36 #include "platform/geometry/IntRect.h" |
35 #include "platform/geometry/LayoutRect.h" | 37 #include "platform/geometry/LayoutRect.h" |
36 #include "platform/graphics/GraphicsContext.h" | 38 #include "platform/graphics/GraphicsContext.h" |
37 #include "platform/graphics/paint/CullRect.h" | 39 #include "platform/graphics/paint/CullRect.h" |
38 #include "platform/graphics/paint/DisplayItem.h" | 40 #include "platform/graphics/paint/DisplayItem.h" |
39 #include "platform/transforms/AffineTransform.h" | 41 #include "platform/transforms/AffineTransform.h" |
40 #include "wtf/Allocator.h" | 42 #include "wtf/Allocator.h" |
41 #include "wtf/HashMap.h" | 43 #include "wtf/HashMap.h" |
(...skipping 23 matching lines...) Expand all Loading... |
65 m_globalPaintFlags(globalPaintFlags) {} | 67 m_globalPaintFlags(globalPaintFlags) {} |
66 | 68 |
67 PaintInfo(GraphicsContext& newContext, const PaintInfo& copyOtherFieldsFrom) | 69 PaintInfo(GraphicsContext& newContext, const PaintInfo& copyOtherFieldsFrom) |
68 : context(newContext), | 70 : context(newContext), |
69 phase(copyOtherFieldsFrom.phase), | 71 phase(copyOtherFieldsFrom.phase), |
70 m_cullRect(copyOtherFieldsFrom.m_cullRect), | 72 m_cullRect(copyOtherFieldsFrom.m_cullRect), |
71 m_paintContainer(copyOtherFieldsFrom.m_paintContainer), | 73 m_paintContainer(copyOtherFieldsFrom.m_paintContainer), |
72 m_paintFlags(copyOtherFieldsFrom.m_paintFlags), | 74 m_paintFlags(copyOtherFieldsFrom.m_paintFlags), |
73 m_globalPaintFlags(copyOtherFieldsFrom.m_globalPaintFlags) {} | 75 m_globalPaintFlags(copyOtherFieldsFrom.m_globalPaintFlags) {} |
74 | 76 |
75 // Creates a PaintInfo for painting descendants. See comments about the paint
phases | 77 // Creates a PaintInfo for painting descendants. See comments about the paint |
76 // in PaintPhase.h for details. | 78 // phases in PaintPhase.h for details. |
77 PaintInfo forDescendants() const { | 79 PaintInfo forDescendants() const { |
78 PaintInfo result(*this); | 80 PaintInfo result(*this); |
79 if (phase == PaintPhaseDescendantOutlinesOnly) | 81 if (phase == PaintPhaseDescendantOutlinesOnly) |
80 result.phase = PaintPhaseOutline; | 82 result.phase = PaintPhaseOutline; |
81 else if (phase == PaintPhaseDescendantBlockBackgroundsOnly) | 83 else if (phase == PaintPhaseDescendantBlockBackgroundsOnly) |
82 result.phase = PaintPhaseBlockBackground; | 84 result.phase = PaintPhaseBlockBackground; |
83 return result; | 85 return result; |
84 } | 86 } |
85 | 87 |
86 bool isRenderingClipPathAsMaskImage() const { | 88 bool isRenderingClipPathAsMaskImage() const { |
(...skipping 18 matching lines...) Expand all Loading... |
105 } | 107 } |
106 | 108 |
107 GlobalPaintFlags getGlobalPaintFlags() const { return m_globalPaintFlags; } | 109 GlobalPaintFlags getGlobalPaintFlags() const { return m_globalPaintFlags; } |
108 | 110 |
109 PaintLayerFlags paintFlags() const { return m_paintFlags; } | 111 PaintLayerFlags paintFlags() const { return m_paintFlags; } |
110 | 112 |
111 const CullRect& cullRect() const { return m_cullRect; } | 113 const CullRect& cullRect() const { return m_cullRect; } |
112 | 114 |
113 void updateCullRect(const AffineTransform& localToParentTransform); | 115 void updateCullRect(const AffineTransform& localToParentTransform); |
114 | 116 |
115 // FIXME: Introduce setters/getters at some point. Requires a lot of changes t
hroughout layout/. | 117 // FIXME: Introduce setters/getters at some point. Requires a lot of changes |
| 118 // throughout layout/. |
116 GraphicsContext& context; | 119 GraphicsContext& context; |
117 PaintPhase phase; | 120 PaintPhase phase; |
118 | 121 |
119 private: | 122 private: |
120 CullRect m_cullRect; | 123 CullRect m_cullRect; |
121 const LayoutBoxModelObject* | 124 const LayoutBoxModelObject* m_paintContainer; // the box model object that |
122 m_paintContainer; // the box model object that originates the current pai
nting | 125 // originates the current |
| 126 // painting |
123 | 127 |
124 const PaintLayerFlags m_paintFlags; | 128 const PaintLayerFlags m_paintFlags; |
125 const GlobalPaintFlags m_globalPaintFlags; | 129 const GlobalPaintFlags m_globalPaintFlags; |
126 | 130 |
127 // TODO(chrishtr): temporary while we implement CullRect everywhere. | 131 // TODO(chrishtr): temporary while we implement CullRect everywhere. |
128 friend class SVGPaintContext; | 132 friend class SVGPaintContext; |
129 friend class SVGShapePainter; | 133 friend class SVGShapePainter; |
130 }; | 134 }; |
131 | 135 |
132 } // namespace blink | 136 } // namespace blink |
133 | 137 |
134 #endif // PaintInfo_h | 138 #endif // PaintInfo_h |
OLD | NEW |