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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Until those states are fully fledged, I'll just disable the ASSERTS. | 66 // Until those states are fully fledged, I'll just disable the ASSERTS. |
67 DisableCompositingQueryAsserts disabler; | 67 DisableCompositingQueryAsserts disabler; |
68 if (m_renderer.layer()->hasVisibleContent()) { | 68 if (m_renderer.layer()->hasVisibleContent()) { |
69 RenderView* view = m_renderer.view(); | 69 RenderView* view = m_renderer.view(); |
70 ASSERT(view); | 70 ASSERT(view); |
71 // FIXME: LayoutState does not work with RenderLayers as there is not a
1-to-1 | 71 // FIXME: LayoutState does not work with RenderLayers as there is not a
1-to-1 |
72 // mapping between them and the RenderObjects. It would be neat to enabl
e | 72 // mapping between them and the RenderObjects. It would be neat to enabl
e |
73 // LayoutState outside the layout() phase and use it here. | 73 // LayoutState outside the layout() phase and use it here. |
74 ASSERT(!view->layoutStateEnabled()); | 74 ASSERT(!view->layoutStateEnabled()); |
75 | 75 |
76 const RenderLayerModelObject* repaintContainer = m_renderer.containerFor
Repaint(); | 76 const RenderLayerModelObject* repaintContainer = m_renderer.containerFor
PaintInvalidation(); |
77 LayoutRect oldRepaintRect = m_repaintRect; | 77 LayoutRect oldRepaintRect = m_repaintRect; |
78 LayoutPoint oldOffset = m_offset; | 78 LayoutPoint oldOffset = m_offset; |
79 computeRepaintRects(); | 79 computeRepaintRects(); |
80 shouldCheckForRepaint &= shouldRepaintLayer(); | 80 shouldCheckForRepaint &= shouldRepaintLayer(); |
81 | 81 |
82 if (shouldCheckForRepaint) { | 82 if (shouldCheckForRepaint) { |
83 if (view && !view->document().printing()) { | 83 if (view && !view->document().printing()) { |
84 if (m_repaintStatus & NeedsFullRepaint) { | 84 if (m_repaintStatus & NeedsFullRepaint) { |
85 m_renderer.invalidatePaintUsingContainer(repaintContainer, p
ixelSnappedIntRect(oldRepaintRect), InvalidationLayer); | 85 m_renderer.invalidatePaintUsingContainer(repaintContainer, p
ixelSnappedIntRect(oldRepaintRect), InvalidationLayer); |
86 if (m_repaintRect != oldRepaintRect) | 86 if (m_repaintRect != oldRepaintRect) |
(...skipping 13 matching lines...) Expand all Loading... |
100 | 100 |
101 void RenderLayerRepainter::clearRepaintRects() | 101 void RenderLayerRepainter::clearRepaintRects() |
102 { | 102 { |
103 ASSERT(!m_renderer.layer()->hasVisibleContent()); | 103 ASSERT(!m_renderer.layer()->hasVisibleContent()); |
104 | 104 |
105 m_repaintRect = IntRect(); | 105 m_repaintRect = IntRect(); |
106 } | 106 } |
107 | 107 |
108 void RenderLayerRepainter::computeRepaintRects() | 108 void RenderLayerRepainter::computeRepaintRects() |
109 { | 109 { |
110 const RenderLayerModelObject* repaintContainer = m_renderer.containerForRepa
int(); | 110 const RenderLayerModelObject* repaintContainer = m_renderer.containerForPain
tInvalidation(); |
111 LayoutRect repaintRect = m_renderer.boundsRectForRepaint(repaintContainer); | 111 LayoutRect repaintRect = m_renderer.boundsRectForPaintInvalidation(repaintCo
ntainer); |
112 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { | 112 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
113 // FIXME: We want RenderLayerRepainter to go away when | 113 // FIXME: We want RenderLayerRepainter to go away when |
114 // repaint-after-layout is on by default so we need to figure out how to | 114 // repaint-after-layout is on by default so we need to figure out how to |
115 // handle this update. | 115 // handle this update. |
116 m_renderer.setPreviousPaintInvalidationRect(repaintRect); | 116 m_renderer.setPreviousPaintInvalidationRect(repaintRect); |
117 } else { | 117 } else { |
118 m_repaintRect = repaintRect; | 118 m_repaintRect = repaintRect; |
119 m_offset = m_renderer.positionFromRepaintContainer(repaintContainer); | 119 m_offset = m_renderer.positionFromPaintInvalidationContainer(repaintCont
ainer); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 void RenderLayerRepainter::computeRepaintRectsIncludingNonCompositingDescendants
() | 123 void RenderLayerRepainter::computeRepaintRectsIncludingNonCompositingDescendants
() |
124 { | 124 { |
125 // FIXME: computeRepaintRects() has to walk up the parent chain for every la
yer to compute the rects. | 125 // FIXME: computeRepaintRects() has to walk up the parent chain for every la
yer to compute the rects. |
126 // We should make this more efficient. | 126 // We should make this more efficient. |
127 // FIXME: it's wrong to call this when layout is not up-to-date, which we do
. | 127 // FIXME: it's wrong to call this when layout is not up-to-date, which we do
. |
128 computeRepaintRects(); | 128 computeRepaintRects(); |
129 | 129 |
(...skipping 12 matching lines...) Expand all Loading... |
142 return true; | 142 return true; |
143 | 143 |
144 // Composited layers that were moved during a positioned movement only | 144 // Composited layers that were moved during a positioned movement only |
145 // layout, don't need to be repainted. They just need to be recomposited. | 145 // layout, don't need to be repainted. They just need to be recomposited. |
146 return m_renderer.compositingState() != PaintsIntoOwnBacking; | 146 return m_renderer.compositingState() != PaintsIntoOwnBacking; |
147 } | 147 } |
148 | 148 |
149 // Since we're only painting non-composited layers, we know that they all share
the same repaintContainer. | 149 // Since we're only painting non-composited layers, we know that they all share
the same repaintContainer. |
150 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants() | 150 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants() |
151 { | 151 { |
152 repaintIncludingNonCompositingDescendantsInternal(m_renderer.containerForRep
aint()); | 152 repaintIncludingNonCompositingDescendantsInternal(m_renderer.containerForPai
ntInvalidation()); |
153 } | 153 } |
154 | 154 |
155 void RenderLayerRepainter::repaintIncludingNonCompositingDescendantsInternal(con
st RenderLayerModelObject* repaintContainer) | 155 void RenderLayerRepainter::repaintIncludingNonCompositingDescendantsInternal(con
st RenderLayerModelObject* repaintContainer) |
156 { | 156 { |
157 m_renderer.invalidatePaintUsingContainer(repaintContainer, pixelSnappedIntRe
ct(m_renderer.boundsRectForRepaint(repaintContainer)), InvalidationLayer); | 157 m_renderer.invalidatePaintUsingContainer(repaintContainer, pixelSnappedIntRe
ct(m_renderer.boundsRectForPaintInvalidation(repaintContainer)), InvalidationLay
er); |
158 | 158 |
159 // FIXME: Repaints can be issued during style recalc at present, via RenderL
ayerModelObject::styleWillChange. This happens in scenarios when | 159 // FIXME: Repaints can be issued during style recalc at present, via RenderL
ayerModelObject::styleWillChange. This happens in scenarios when |
160 // repaint is needed but not layout. | 160 // repaint is needed but not layout. |
161 DisableCompositingQueryAsserts disabler; | 161 DisableCompositingQueryAsserts disabler; |
162 | 162 |
163 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr
->nextSibling()) { | 163 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr
->nextSibling()) { |
164 if (curr->compositingState() != PaintsIntoOwnBacking && curr->compositin
gState() != PaintsIntoGroupedBacking) | 164 if (curr->compositingState() != PaintsIntoOwnBacking && curr->compositin
gState() != PaintsIntoGroupedBacking) |
165 curr->repainter().repaintIncludingNonCompositingDescendantsInternal(
repaintContainer); | 165 curr->repainter().repaintIncludingNonCompositingDescendantsInternal(
repaintContainer); |
166 } | 166 } |
167 } | 167 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const | 264 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const |
265 { | 265 { |
266 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent
()) { | 266 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent
()) { |
267 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter
s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) | 267 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter
s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) |
268 return const_cast<RenderLayer*>(curr); | 268 return const_cast<RenderLayer*>(curr); |
269 } | 269 } |
270 return 0; | 270 return 0; |
271 } | 271 } |
272 | 272 |
273 } // Namespace WebCore | 273 } // Namespace WebCore |
OLD | NEW |