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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 /* | 48 /* |
49 * Paint the object and its children, clipped by (x|y|w|h). | 49 * Paint the object and its children, clipped by (x|y|w|h). |
50 * (tx|ty) is the calculated position of the parent | 50 * (tx|ty) is the calculated position of the parent |
51 */ | 51 */ |
52 struct PaintInfo { | 52 struct PaintInfo { |
53 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, PaintBehavior newPaintBehavior, | 53 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, PaintBehavior newPaintBehavior, |
54 RenderObject* newPaintingRoot = 0, RenderRegion* region = 0, ListHashSet
<RenderInline*>* newOutlineObjects = 0, | 54 RenderObject* newPaintingRoot = 0, RenderRegion* region = 0, ListHashSet
<RenderInline*>* newOutlineObjects = 0, |
55 OverlapTestRequestMap* overlapTestRequests = 0, const RenderLayerModelOb
ject* newPaintContainer = 0) | 55 OverlapTestRequestMap* overlapTestRequests = 0, const RenderLayerModelOb
ject* newPaintContainer = 0) |
56 : context(newContext) | 56 : context(newContext) |
| 57 , rect(newRect) |
57 , phase(newPhase) | 58 , phase(newPhase) |
58 , paintBehavior(newPaintBehavior) | 59 , paintBehavior(newPaintBehavior) |
59 , paintingRoot(newPaintingRoot) | 60 , paintingRoot(newPaintingRoot) |
60 , renderRegion(region) | 61 , renderRegion(region) |
61 , overlapTestRequests(overlapTestRequests) | 62 , overlapTestRequests(overlapTestRequests) |
62 , m_paintContainer(newPaintContainer) | 63 , m_paintContainer(newPaintContainer) |
63 , m_outlineObjects(newOutlineObjects) | 64 , m_outlineObjects(newOutlineObjects) |
64 , m_rect(newRect) | |
65 { | 65 { |
66 } | 66 } |
67 | 67 |
68 void updatePaintingRootForChildren(const RenderObject* renderer) | 68 void updatePaintingRootForChildren(const RenderObject* renderer) |
69 { | 69 { |
70 if (!paintingRoot) | 70 if (!paintingRoot) |
71 return; | 71 return; |
72 | 72 |
73 // If we're the painting root, kids draw normally, and see root of 0. | 73 // If we're the painting root, kids draw normally, and see root of 0. |
74 if (paintingRoot == renderer) { | 74 if (paintingRoot == renderer) { |
(...skipping 12 matching lines...) Expand all Loading... |
87 bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRo
otBackground; } | 87 bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRo
otBackground; } |
88 bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorR
ootBackgroundOnly; } | 88 bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorR
ootBackgroundOnly; } |
89 | 89 |
90 void applyTransform(const AffineTransform& localToAncestorTransform) | 90 void applyTransform(const AffineTransform& localToAncestorTransform) |
91 { | 91 { |
92 if (localToAncestorTransform.isIdentity()) | 92 if (localToAncestorTransform.isIdentity()) |
93 return; | 93 return; |
94 | 94 |
95 context->concatCTM(localToAncestorTransform); | 95 context->concatCTM(localToAncestorTransform); |
96 | 96 |
97 if (m_rect == infiniteRect()) | 97 if (rect == infiniteRect()) |
98 return; | 98 return; |
99 | 99 |
100 m_rect = localToAncestorTransform.inverse().mapRect(m_rect); | 100 rect = localToAncestorTransform.inverse().mapRect(rect); |
101 } | 101 } |
102 | 102 |
103 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect());
} | 103 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect());
} |
104 const RenderLayerModelObject* paintContainer() const { return m_paintContain
er; } | 104 const RenderLayerModelObject* paintContainer() const { return m_paintContain
er; } |
105 | 105 |
106 ListHashSet<RenderInline*>* outlineObjects() { return m_outlineObjects; } | 106 ListHashSet<RenderInline*>* outlineObjects() { return m_outlineObjects; } |
107 void setOutlineObjects(ListHashSet<RenderInline*>* objects) { m_outlineObjec
ts = objects; } | 107 void setOutlineObjects(ListHashSet<RenderInline*>* objects) { m_outlineObjec
ts = objects; } |
108 | 108 |
109 const IntRect& rect() const { return m_rect; } | |
110 IntRect& rect() { return m_rect; } | |
111 void setRect(const IntRect& rect) { m_rect = rect; } | |
112 | |
113 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout rendering/. | 109 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout rendering/. |
114 GraphicsContext* context; | 110 GraphicsContext* context; |
| 111 IntRect rect; |
115 PaintPhase phase; | 112 PaintPhase phase; |
116 PaintBehavior paintBehavior; | 113 PaintBehavior paintBehavior; |
117 RenderObject* paintingRoot; // used to draw just one element and its visual
kids | 114 RenderObject* paintingRoot; // used to draw just one element and its visual
kids |
118 RenderRegion* renderRegion; | 115 RenderRegion* renderRegion; |
119 OverlapTestRequestMap* overlapTestRequests; | 116 OverlapTestRequestMap* overlapTestRequests; |
120 | 117 |
121 private: | 118 private: |
122 | 119 |
123 const RenderLayerModelObject* m_paintContainer; // the layer object that ori
ginates the current painting | 120 const RenderLayerModelObject* m_paintContainer; // the layer object that ori
ginates the current painting |
124 ListHashSet<RenderInline*>* m_outlineObjects; // used to list outlines that
should be painted by a block with inline children | 121 ListHashSet<RenderInline*>* m_outlineObjects; // used to list outlines that
should be painted by a block with inline children |
125 IntRect m_rect; | |
126 }; | 122 }; |
127 | 123 |
128 } // namespace WebCore | 124 } // namespace WebCore |
129 | 125 |
130 #endif // PaintInfo_h | 126 #endif // PaintInfo_h |
OLD | NEW |