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 25 matching lines...) Expand all Loading... |
36 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
37 #include "wtf/ListHashSet.h" | 37 #include "wtf/ListHashSet.h" |
38 | 38 |
39 #include <limits> | 39 #include <limits> |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class LayoutInline; | 43 class LayoutInline; |
44 class LayoutBoxModelObject; | 44 class LayoutBoxModelObject; |
45 class LayoutObject; | 45 class LayoutObject; |
| 46 class PaintDataCache; |
46 | 47 |
47 struct PaintInfo { | 48 struct PaintInfo { |
48 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, PaintBehavior newPaintBehavior, | 49 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, PaintBehavior newPaintBehavior, |
49 LayoutObject* newPaintingRoot = 0, ListHashSet<LayoutInline*>* newOutlin
eObjects = 0, | 50 LayoutObject* newPaintingRoot = 0, ListHashSet<LayoutInline*>* newOutlin
eObjects = 0, |
50 const LayoutBoxModelObject* newPaintContainer = 0) | 51 const LayoutBoxModelObject* newPaintContainer = 0, |
| 52 PaintDataCache* newPaintDataCache = nullptr) |
51 : context(newContext) | 53 : context(newContext) |
52 , rect(newRect) | 54 , rect(newRect) |
53 , phase(newPhase) | 55 , phase(newPhase) |
54 , paintBehavior(newPaintBehavior) | 56 , paintBehavior(newPaintBehavior) |
55 , paintingRoot(newPaintingRoot) | 57 , paintingRoot(newPaintingRoot) |
56 , m_paintContainer(newPaintContainer) | 58 , m_paintContainer(newPaintContainer) |
57 , m_outlineObjects(newOutlineObjects) | 59 , m_outlineObjects(newOutlineObjects) |
| 60 , m_paintDataCache(newPaintDataCache) |
58 { | 61 { |
59 } | 62 } |
60 | 63 |
61 void updatePaintingRootForChildren(const LayoutObject* layoutObject) | 64 void updatePaintingRootForChildren(const LayoutObject* layoutObject) |
62 { | 65 { |
63 if (!paintingRoot) | 66 if (!paintingRoot) |
64 return; | 67 return; |
65 | 68 |
66 // If we're the painting root, kids draw normally, and see root of 0. | 69 // If we're the painting root, kids draw normally, and see root of 0. |
67 if (paintingRoot == layoutObject) { | 70 if (paintingRoot == layoutObject) { |
(...skipping 23 matching lines...) Expand all Loading... |
91 { | 94 { |
92 return transform.mapRect(boundingBox).intersects(rect); | 95 return transform.mapRect(boundingBox).intersects(rect); |
93 } | 96 } |
94 | 97 |
95 void updateCullRectForSVGTransform(const AffineTransform& localToParentTrans
form) | 98 void updateCullRectForSVGTransform(const AffineTransform& localToParentTrans
form) |
96 { | 99 { |
97 if (rect != LayoutRect::infiniteIntRect()) | 100 if (rect != LayoutRect::infiniteIntRect()) |
98 rect = localToParentTransform.inverse().mapRect(rect); | 101 rect = localToParentTransform.inverse().mapRect(rect); |
99 } | 102 } |
100 | 103 |
| 104 PaintDataCache* paintDataCache() const { return m_paintDataCache; } |
| 105 |
101 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout layout/. | 106 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout layout/. |
102 GraphicsContext* context; | 107 GraphicsContext* context; |
103 IntRect rect; // dirty rect used for culling non-intersecting layoutObjects | 108 IntRect rect; // dirty rect used for culling non-intersecting layoutObjects |
104 PaintPhase phase; | 109 PaintPhase phase; |
105 PaintBehavior paintBehavior; | 110 PaintBehavior paintBehavior; |
106 LayoutObject* paintingRoot; // used to draw just one element and its visual
kids | 111 LayoutObject* paintingRoot; // used to draw just one element and its visual
kids |
107 | 112 |
108 private: | 113 private: |
109 const LayoutBoxModelObject* m_paintContainer; // the box model object that o
riginates the current painting | 114 const LayoutBoxModelObject* m_paintContainer; // the box model object that o
riginates the current painting |
110 ListHashSet<LayoutInline*>* m_outlineObjects; // used to list outlines that
should be painted by a block with inline children | 115 ListHashSet<LayoutInline*>* m_outlineObjects; // used to list outlines that
should be painted by a block with inline children |
| 116 PaintDataCache* m_paintDataCache; // caches information frequently needed du
ring paint |
111 }; | 117 }; |
112 | 118 |
113 } // namespace blink | 119 } // namespace blink |
114 | 120 |
115 #endif // PaintInfo_h | 121 #endif // PaintInfo_h |
OLD | NEW |