Unverified Commit 8e5d77d3 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Make animating opacity cheaper. (#13583)

No need to update the compositing bits all the time.
parent 813be533
......@@ -736,10 +736,14 @@ class RenderOpacity extends RenderProxyBox {
assert(value >= 0.0 && value <= 1.0);
if (_opacity == value)
return;
final bool didNeedCompositing = alwaysNeedsCompositing;
final bool wasVisible = _alpha != 0;
_opacity = value;
_alpha = _getAlphaFromOpacity(_opacity);
if (didNeedCompositing != alwaysNeedsCompositing)
markNeedsCompositingBitsUpdate();
markNeedsPaint();
if (wasVisible != (_alpha != 0))
markNeedsSemanticsUpdate();
}
......@@ -1354,7 +1358,9 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
assert(value != null);
if (elevation == value)
return;
final bool didNeedCompositing = alwaysNeedsCompositing;
_elevation = value;
if (didNeedCompositing != alwaysNeedsCompositing)
markNeedsCompositingBitsUpdate();
markNeedsPaint();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment