Chromium Code Reviews| 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 IntRect offsetRect = pixelSnappedIntRect(r); | |
| 187 offsetRect.move(-m_renderer->layer()->offsetFromSquashingLayerOrigin ()); | |
|
enne (OOO)
2013/11/27 23:20:26
Should you be storing all of these offsets as Layo
shawnsingh
2013/12/02 01:55:03
Would you be OK with us moving forward with this v
| |
| 188 m_renderer->groupedMapping()->squashingLayer()->setNeedsDisplayInRec t(offsetRect); | |
| 189 } else { | |
| 190 m_renderer->compositedLayerMapping()->setContentsNeedDisplayInRect(p ixelSnappedIntRect(r)); | |
| 191 } | |
| 180 } | 192 } |
| 181 } | 193 } |
| 182 | 194 |
| 183 void RenderLayerRepainter::repaintIncludingDescendants() | 195 void RenderLayerRepainter::repaintIncludingDescendants() |
| 184 { | 196 { |
| 185 m_renderer->repaint(); | 197 m_renderer->repaint(); |
| 186 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur r->nextSibling()) | 198 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur r->nextSibling()) |
| 187 curr->repainter().repaintIncludingDescendants(); | 199 curr->repainter().repaintIncludingDescendants(); |
| 188 } | 200 } |
| 189 | 201 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const | 246 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const |
| 235 { | 247 { |
| 236 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren t()) { | 248 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() ) | 249 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer() ) |
| 238 return const_cast<RenderLayer*>(curr); | 250 return const_cast<RenderLayer*>(curr); |
| 239 } | 251 } |
| 240 return 0; | 252 return 0; |
| 241 } | 253 } |
| 242 | 254 |
| 243 } // Namespace WebCore | 255 } // Namespace WebCore |
| OLD | NEW |