| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Since we're only painting non-composited layers, we know that they all share
the same repaintContainer. | 147 // Since we're only painting non-composited layers, we know that they all share
the same repaintContainer. |
| 148 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants() | 148 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants() |
| 149 { | 149 { |
| 150 repaintIncludingNonCompositingDescendantsInternal(m_renderer.containerForRep
aint()); | 150 repaintIncludingNonCompositingDescendantsInternal(m_renderer.containerForRep
aint()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void RenderLayerRepainter::repaintIncludingNonCompositingDescendantsInternal(con
st RenderLayerModelObject* repaintContainer) | 153 void RenderLayerRepainter::repaintIncludingNonCompositingDescendantsInternal(con
st RenderLayerModelObject* repaintContainer) |
| 154 { | 154 { |
| 155 m_renderer.repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_ren
derer.computeRepaintRect()), InvalidationLayer); | 155 m_renderer.repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_ren
derer.boundsRectForRepaint(repaintContainer)), InvalidationLayer); |
| 156 |
| 157 // FIXME: Repaints can be issued during style recalc at present, via RenderL
ayerModelObject::styleWillChange. This happens in scenarios when |
| 158 // repaint is needed but not layout. |
| 159 DisableCompositingQueryAsserts disabler; |
| 156 | 160 |
| 157 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr
->nextSibling()) { | 161 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr
->nextSibling()) { |
| 158 if (!curr->hasCompositedLayerMapping()) | 162 if (curr->compositingState() != PaintsIntoOwnBacking && curr->compositin
gState() != PaintsIntoGroupedBacking) |
| 159 curr->repainter().repaintIncludingNonCompositingDescendantsInternal(
repaintContainer); | 163 curr->repainter().repaintIncludingNonCompositingDescendantsInternal(
repaintContainer); |
| 160 } | 164 } |
| 161 } | 165 } |
| 162 | 166 |
| 163 LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants()
const | 167 LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants()
const |
| 164 { | 168 { |
| 165 LayoutRect repaintRect; | 169 LayoutRect repaintRect; |
| 166 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 170 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| 167 repaintRect = m_renderer.previousPaintInvalidationRect(); | 171 repaintRect = m_renderer.previousPaintInvalidationRect(); |
| 168 else | 172 else |
| 169 repaintRect = m_repaintRect; | 173 repaintRect = m_repaintRect; |
| 170 | 174 |
| 171 for (RenderLayer* child = m_renderer.layer()->firstChild(); child; child = c
hild->nextSibling()) { | 175 for (RenderLayer* child = m_renderer.layer()->firstChild(); child; child = c
hild->nextSibling()) { |
| 172 // Don't include repaint rects for composited child layers; they will pa
int themselves and have a different origin. | 176 // Don't include repaint rects for composited child layers; they will pa
int themselves and have a different origin. |
| 173 if (child->hasCompositedLayerMapping()) | 177 if (child->compositingState() == PaintsIntoOwnBacking || child->composit
ingState() == PaintsIntoGroupedBacking) |
| 174 continue; | 178 continue; |
| 175 | 179 |
| 176 repaintRect.unite(child->repainter().repaintRectIncludingNonCompositingD
escendants()); | 180 repaintRect.unite(child->repainter().repaintRectIncludingNonCompositingD
escendants()); |
| 177 } | 181 } |
| 178 return repaintRect; | 182 return repaintRect; |
| 179 } | 183 } |
| 180 | 184 |
| 181 void RenderLayerRepainter::setBackingNeedsRepaint() | 185 void RenderLayerRepainter::setBackingNeedsRepaint() |
| 182 { | 186 { |
| 183 // There is only one call site, and that call site ensures that the composit
ing state is PaintsIntoOwnBacking. | 187 // There is only one call site, and that call site ensures that the composit
ing state is PaintsIntoOwnBacking. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const | 262 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const |
| 259 { | 263 { |
| 260 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent
()) { | 264 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent
()) { |
| 261 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter
s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) | 265 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter
s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) |
| 262 return const_cast<RenderLayer*>(curr); | 266 return const_cast<RenderLayer*>(curr); |
| 263 } | 267 } |
| 264 return 0; | 268 return 0; |
| 265 } | 269 } |
| 266 | 270 |
| 267 } // Namespace WebCore | 271 } // Namespace WebCore |
| OLD | NEW |