OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. | 7 * Copyright (C) 2010, 2012 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 frameView->removeViewportConstrainedObject(this); | 81 frameView->removeViewportConstrainedObject(this); |
82 } | 82 } |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 RenderObject::willBeDestroyed(); | 86 RenderObject::willBeDestroyed(); |
87 | 87 |
88 destroyLayer(); | 88 destroyLayer(); |
89 } | 89 } |
90 | 90 |
91 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS
tyle* newStyle) | 91 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS
tyle& newStyle) |
92 { | 92 { |
93 s_wasFloating = isFloating(); | 93 s_wasFloating = isFloating(); |
94 | 94 |
95 // If our z-index changes value or our visibility changes, | 95 // If our z-index changes value or our visibility changes, |
96 // we need to dirty our stacking context's z-order list. | 96 // we need to dirty our stacking context's z-order list. |
97 RenderStyle* oldStyle = style(); | 97 RenderStyle* oldStyle = style(); |
98 if (oldStyle && newStyle) { | 98 if (oldStyle) { |
99 if (parent()) { | 99 if (parent()) { |
100 // Do a repaint with the old style first, e.g., for example if we go
from | 100 // Do a repaint with the old style first, e.g., for example if we go
from |
101 // having an outline to not having an outline. | 101 // having an outline to not having an outline. |
102 if (diff == StyleDifferenceRepaintLayer) { | 102 if (diff == StyleDifferenceRepaintLayer) { |
103 layer()->repainter().repaintIncludingDescendants(); | 103 layer()->repainter().repaintIncludingDescendants(); |
104 if (oldStyle->clip() != newStyle->clip()) | 104 if (oldStyle->clip() != newStyle.clip()) |
105 layer()->clipper().clearClipRectsIncludingDescendants(); | 105 layer()->clipper().clearClipRectsIncludingDescendants(); |
106 } else if (diff == StyleDifferenceRepaint || newStyle->outlineSize()
< oldStyle->outlineSize()) | 106 } else if (diff == StyleDifferenceRepaint || newStyle.outlineSize()
< oldStyle->outlineSize()) |
107 repaint(); | 107 repaint(); |
108 } | 108 } |
109 | 109 |
110 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLa
yout) { | 110 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLa
yout) { |
111 // When a layout hint happens, we go ahead and do a repaint of the l
ayer, since the layer could | 111 // When a layout hint happens, we go ahead and do a repaint of the l
ayer, since the layer could |
112 // end up being destroyed. | 112 // end up being destroyed. |
113 if (hasLayer()) { | 113 if (hasLayer()) { |
114 if (oldStyle->hasClip() != newStyle->hasClip() | 114 if (oldStyle->hasClip() != newStyle.hasClip() |
115 || oldStyle->clip() != newStyle->clip()) { | 115 || oldStyle->clip() != newStyle.clip()) { |
116 // Composited layers don't need to be repainted when a paren
t's clip changes. | 116 // Composited layers don't need to be repainted when a paren
t's clip changes. |
117 layer()->repainter().repaintIncludingNonCompositingDescendan
ts(containerForRepaint()); | 117 layer()->repainter().repaintIncludingNonCompositingDescendan
ts(containerForRepaint()); |
118 } else if (!layer()->hasCompositedLayerMapping()) { | 118 } else if (!layer()->hasCompositedLayerMapping()) { |
119 if (oldStyle->position() != newStyle->position() | 119 if (oldStyle->position() != newStyle.position() |
120 || oldStyle->zIndex() != newStyle->zIndex() | 120 || oldStyle->zIndex() != newStyle.zIndex() |
121 || oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex(
) | 121 || oldStyle->hasAutoZIndex() != newStyle.hasAutoZIndex() |
122 || oldStyle->opacity() != newStyle->opacity() | 122 || oldStyle->opacity() != newStyle.opacity() |
123 || oldStyle->transform() != newStyle->transform() | 123 || oldStyle->transform() != newStyle.transform() |
124 || oldStyle->filter() != newStyle->filter()) | 124 || oldStyle->filter() != newStyle.filter()) |
125 layer()->repainter().repaintIncludingDescendants(); | 125 layer()->repainter().repaintIncludingDescendants(); |
126 } | 126 } |
127 } else if (newStyle->hasTransform() || newStyle->opacity() < 1 || ne
wStyle->hasFilter()) { | 127 } else if (newStyle.hasTransform() || newStyle.opacity() < 1 || newS
tyle.hasFilter()) { |
128 // If we don't have a layer yet, but we are going to get one bec
ause of transform or opacity, | 128 // If we don't have a layer yet, but we are going to get one bec
ause of transform or opacity, |
129 // then we need to repaint the old position of the object. | 129 // then we need to repaint the old position of the object. |
130 repaint(); | 130 repaint(); |
131 } | 131 } |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 RenderObject::styleWillChange(diff, newStyle); | 135 RenderObject::styleWillChange(diff, newStyle); |
136 } | 136 } |
137 | 137 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 return m_layer ? m_layer->hasCompositedLayerMapping() : false; | 222 return m_layer ? m_layer->hasCompositedLayerMapping() : false; |
223 } | 223 } |
224 | 224 |
225 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const | 225 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const |
226 { | 226 { |
227 return m_layer ? m_layer->groupedMapping() : 0; | 227 return m_layer ? m_layer->groupedMapping() : 0; |
228 } | 228 } |
229 | 229 |
230 } // namespace WebCore | 230 } // namespace WebCore |
231 | 231 |
OLD | NEW |