OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (child->hasCompositedLayerMapping()) | 148 if (child->hasCompositedLayerMapping()) |
149 continue; | 149 continue; |
150 | 150 |
151 repaintRect.unite(child->repainter().repaintRectIncludingNonCompositingD
escendants()); | 151 repaintRect.unite(child->repainter().repaintRectIncludingNonCompositingD
escendants()); |
152 } | 152 } |
153 return repaintRect; | 153 return repaintRect; |
154 } | 154 } |
155 | 155 |
156 void RenderLayerRepainter::setBackingNeedsRepaint() | 156 void RenderLayerRepainter::setBackingNeedsRepaint() |
157 { | 157 { |
158 ASSERT(m_renderer->hasCompositedLayerMapping()); | 158 ASSERT(m_renderer->compositingState() != NotComposited); |
159 m_renderer->compositedLayerMapping()->setContentsNeedDisplay(); | 159 |
| 160 if (m_renderer->compositingState() == PaintsIntoGroupedBacking) { |
| 161 // FIXME: should probably setNeedsDisplayInRect for this layer's bounds
only. |
| 162 m_renderer->groupedMapping()->squashingLayer()->setNeedsDisplay(); |
| 163 } else { |
| 164 m_renderer->compositedLayerMapping()->setContentsNeedDisplay(); |
| 165 } |
160 } | 166 } |
161 | 167 |
162 void RenderLayerRepainter::setBackingNeedsRepaintInRect(const LayoutRect& r) | 168 void RenderLayerRepainter::setBackingNeedsRepaintInRect(const LayoutRect& r) |
163 { | 169 { |
164 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 170 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
165 // so assert but check that the layer is composited. | 171 // so assert but check that the layer is composited. |
166 ASSERT(m_renderer->hasCompositedLayerMapping()); | 172 ASSERT(m_renderer->compositingState() != NotComposited); |
167 if (!m_renderer->hasCompositedLayerMapping()) { | 173 if (m_renderer->compositingState() == NotComposited) { |
168 // If we're trying to repaint the placeholder document layer, propagate
the | 174 // If we're trying to repaint the placeholder document layer, propagate
the |
169 // repaint to the native view system. | 175 // repaint to the native view system. |
170 LayoutRect absRect(r); | 176 LayoutRect absRect(r); |
171 LayoutPoint delta; | 177 LayoutPoint delta; |
172 m_renderer->layer()->convertToLayerCoords(m_renderer->layer()->root(), d
elta); | 178 m_renderer->layer()->convertToLayerCoords(m_renderer->layer()->root(), d
elta); |
173 absRect.moveBy(delta); | 179 absRect.moveBy(delta); |
174 | 180 |
175 RenderView* view = m_renderer->view(); | 181 RenderView* view = m_renderer->view(); |
176 if (view) | 182 if (view) |
177 view->repaintViewRectangle(absRect); | 183 view->repaintViewRectangle(absRect); |
178 } else { | 184 } else { |
179 m_renderer->compositedLayerMapping()->setContentsNeedDisplayInRect(pixel
SnappedIntRect(r)); | 185 if (m_renderer->compositingState() == PaintsIntoGroupedBacking) { |
| 186 // FIXME: LayoutRect rounding to IntRect is probably not a good idea
. |
| 187 IntRect offsetRect = pixelSnappedIntRect(r); |
| 188 if (m_renderer->hasTransform()) |
| 189 offsetRect = m_renderer->layer()->transform()->mapRect(pixelSnap
pedIntRect(r)); |
| 190 |
| 191 offsetRect.move(-m_renderer->layer()->offsetFromSquashingLayerOrigin
()); |
| 192 m_renderer->groupedMapping()->squashingLayer()->setNeedsDisplayInRec
t(offsetRect); |
| 193 } else { |
| 194 m_renderer->compositedLayerMapping()->setContentsNeedDisplayInRect(p
ixelSnappedIntRect(r)); |
| 195 } |
180 } | 196 } |
181 } | 197 } |
182 | 198 |
183 void RenderLayerRepainter::repaintIncludingDescendants() | 199 void RenderLayerRepainter::repaintIncludingDescendants() |
184 { | 200 { |
185 m_renderer->repaint(); | 201 m_renderer->repaint(); |
186 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur
r->nextSibling()) | 202 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur
r->nextSibling()) |
187 curr->repainter().repaintIncludingDescendants(); | 203 curr->repainter().repaintIncludingDescendants(); |
188 } | 204 } |
189 | 205 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const | 250 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const |
235 { | 251 { |
236 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren
t()) { | 252 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren
t()) { |
237 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte
rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()
) | 253 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte
rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()
) |
238 return const_cast<RenderLayer*>(curr); | 254 return const_cast<RenderLayer*>(curr); |
239 } | 255 } |
240 return 0; | 256 return 0; |
241 } | 257 } |
242 | 258 |
243 } // Namespace WebCore | 259 } // Namespace WebCore |
OLD | NEW |