|
Lines 6041-6046
void RenderLayer::updateOutOfFlowPositioned(const RenderStyle* oldStyle)
a/Source/WebCore/rendering/RenderLayer.cpp_sec1
|
| 6041 |
} |
6041 |
} |
| 6042 |
} |
6042 |
} |
| 6043 |
|
6043 |
|
|
|
6044 |
#if ENABLE(CSS_FILTERS) |
| 6045 |
static bool hasOrHadFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) |
| 6046 |
{ |
| 6047 |
ASSERT(newStyle); |
| 6048 |
return (oldStyle && oldStyle->hasFilter()) || newStyle->hasFilter(); |
| 6049 |
} |
| 6050 |
#endif |
| 6051 |
|
| 6044 |
#if USE(ACCELERATED_COMPOSITING) |
6052 |
#if USE(ACCELERATED_COMPOSITING) |
| 6045 |
inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const |
6053 |
inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const |
| 6046 |
{ |
6054 |
{ |
|
Lines 6053-6060
inline bool RenderLayer::needsCompositingLayersRebuiltForOverflow(const RenderSt
a/Source/WebCore/rendering/RenderLayer.cpp_sec2
|
| 6053 |
ASSERT(newStyle); |
6061 |
ASSERT(newStyle); |
| 6054 |
return !isComposited() && oldStyle && (oldStyle->overflowX() != newStyle->overflowX()) && stackingContainer()->hasCompositingDescendant(); |
6062 |
return !isComposited() && oldStyle && (oldStyle->overflowX() != newStyle->overflowX()) && stackingContainer()->hasCompositingDescendant(); |
| 6055 |
} |
6063 |
} |
|
|
6064 |
|
| 6065 |
#if ENABLE(CSS_FILTERS) |
| 6066 |
inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const |
| 6067 |
{ |
| 6068 |
if (!hasOrHadFilters(oldStyle, newStyle)) |
| 6069 |
return false; |
| 6070 |
|
| 6071 |
if (renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilter)) { |
| 6072 |
// When the compositor is performing the filter animation, we shouldn't touch the compositing layers. |
| 6073 |
// All of the layers above us should have been promoted to compositing layers already. |
| 6074 |
return false; |
| 6075 |
} |
| 6076 |
|
| 6077 |
FilterOutsets newOutsets = newStyle->filterOutsets(); |
| 6078 |
if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { |
| 6079 |
// When filter outsets change, we need to: |
| 6080 |
// (1) Recompute the overlap map to promote the correct layers to composited layers. |
| 6081 |
// (2) Update the composited layer bounds (and child GraphicsLayer positions) on platforms |
| 6082 |
// whose compositors can't compute their own filter outsets. |
| 6083 |
return true; |
| 6084 |
} |
| 6085 |
|
| 6086 |
#if HAVE(COMPOSITOR_FILTER_OUTSETS) |
| 6087 |
if ((didPaintWithFilters != paintsWithFilters()) && !newOutsets.isZero()) { |
| 6088 |
// When the layer used to paint filters in software and now paints filters in the |
| 6089 |
// compositor, the compositing layer bounds need to change from including filter outsets to |
| 6090 |
// excluding filter outsets, on platforms whose compositors compute their own outsets. |
| 6091 |
// Similarly for the reverse change from compositor-painted to software-painted filters. |
| 6092 |
return true; |
| 6093 |
} |
| 6094 |
#endif |
| 6095 |
|
| 6096 |
return false; |
| 6097 |
} |
| 6098 |
#endif // ENABLE(CSS_FILTERS) |
| 6056 |
#endif // USE(ACCELERATED_COMPOSITING) |
6099 |
#endif // USE(ACCELERATED_COMPOSITING) |
| 6057 |
|
6100 |
|
|
|
6101 |
#if ENABLE(CSS_FILTERS) |
| 6102 |
void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) |
| 6103 |
{ |
| 6104 |
if (!hasOrHadFilters(oldStyle, newStyle)) |
| 6105 |
return; |
| 6106 |
|
| 6107 |
updateOrRemoveFilterClients(); |
| 6108 |
#if USE(ACCELERATED_COMPOSITING) |
| 6109 |
if (isComposited() && !renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilter)) { |
| 6110 |
// During an accelerated animation, both WebKit and the compositor animate properties. |
| 6111 |
// However, WebKit shouldn't ask the compositor to update its filters if the compositor is performing the animation. |
| 6112 |
backing()->updateFilters(renderer()->style()); |
| 6113 |
} |
| 6114 |
#endif |
| 6115 |
updateOrRemoveFilterEffectRenderer(); |
| 6116 |
} |
| 6117 |
#endif |
| 6118 |
|
| 6058 |
void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) |
6119 |
void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) |
| 6059 |
{ |
6120 |
{ |
| 6060 |
bool isNormalFlowOnly = shouldBeNormalFlowOnly(); |
6121 |
bool isNormalFlowOnly = shouldBeNormalFlowOnly(); |
|
Lines 6106-6113
void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
a/Source/WebCore/rendering/RenderLayer.cpp_sec3
|
| 6106 |
#if ENABLE(CSS_COMPOSITING) |
6167 |
#if ENABLE(CSS_COMPOSITING) |
| 6107 |
updateBlendMode(); |
6168 |
updateBlendMode(); |
| 6108 |
#endif |
6169 |
#endif |
|
|
6170 |
|
| 6171 |
#if USE(ACCELERATED_COMPOSITING) |
| 6172 |
bool didPaintWithFilters = false; |
| 6173 |
#endif |
| 6109 |
#if ENABLE(CSS_FILTERS) |
6174 |
#if ENABLE(CSS_FILTERS) |
| 6110 |
updateOrRemoveFilterClients(); |
6175 |
if (paintsWithFilters()) |
|
|
6176 |
didPaintWithFilters = true; |
| 6177 |
updateFilters(oldStyle, renderer()->style()); |
| 6111 |
#endif |
6178 |
#endif |
| 6112 |
|
6179 |
|
| 6113 |
#if USE(ACCELERATED_COMPOSITING) |
6180 |
#if USE(ACCELERATED_COMPOSITING) |
|
Lines 6116-6138
void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
a/Source/WebCore/rendering/RenderLayer.cpp_sec4
|
| 6116 |
const RenderStyle* newStyle = renderer()->style(); |
6183 |
const RenderStyle* newStyle = renderer()->style(); |
| 6117 |
if (compositor()->updateLayerCompositingState(this) |
6184 |
if (compositor()->updateLayerCompositingState(this) |
| 6118 |
|| needsCompositingLayersRebuiltForClip(oldStyle, newStyle) |
6185 |
|| needsCompositingLayersRebuiltForClip(oldStyle, newStyle) |
| 6119 |
|| needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle)) |
6186 |
|| needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) |
|
|
6187 |
|| needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintWithFilters)) |
| 6120 |
compositor()->setCompositingLayersNeedRebuild(); |
6188 |
compositor()->setCompositingLayersNeedRebuild(); |
| 6121 |
else if (isComposited()) |
6189 |
else if (isComposited()) |
| 6122 |
backing()->updateGraphicsLayerGeometry(); |
6190 |
backing()->updateGraphicsLayerGeometry(); |
| 6123 |
#endif |
6191 |
#endif |
| 6124 |
|
|
|
| 6125 |
#if ENABLE(CSS_FILTERS) |
| 6126 |
updateOrRemoveFilterEffectRenderer(); |
| 6127 |
#if USE(ACCELERATED_COMPOSITING) |
| 6128 |
bool backingDidCompositeLayers = isComposited() && backing()->canCompositeFilters(); |
| 6129 |
if (isComposited() && backingDidCompositeLayers && !backing()->canCompositeFilters()) { |
| 6130 |
// The filters used to be drawn by platform code, but now the platform cannot draw them anymore. |
| 6131 |
// Fallback to drawing them in software. |
| 6132 |
setBackingNeedsRepaint(); |
| 6133 |
} |
| 6134 |
#endif |
| 6135 |
#endif |
| 6136 |
} |
6192 |
} |
| 6137 |
|
6193 |
|
| 6138 |
void RenderLayer::updateScrollableAreaSet(bool hasOverflow) |
6194 |
void RenderLayer::updateScrollableAreaSet(bool hasOverflow) |