Make sure Opacity widgets/layers do not drop the offset #89264
Conversation
Gold has detected about 4 new digest(s) on patchset 1. |
Gold has detected about 1 new digest(s) on patchset 2. |
Gold has detected about 1 new digest(s) on patchset 3. |
if (enabled) | ||
final int realizedAlpha = alpha!; | ||
// The type assertions work because the [alpha] setter nulls out the | ||
// engineLayer if it would ahve changed type (i.e. changed to or from 255). |
xu-baolin
Sep 1, 2021
Member
ahve
-> have
ahve
-> have
@@ -208,4 +208,30 @@ void main() { | |||
expect(error, isNull); | |||
debugPaintSizeEnabled = false; | |||
}); | |||
|
|||
test('debugDisableOpacity keeps things in the right spot', () { |
xu-baolin
Sep 1, 2021
Member
Without this patch, this test can pass also, right?
Without this patch, this test can pass also, right?
dnfield
Sep 1, 2021
Author
Member
The container gets rendered in the wrong location without this patch
The container gets rendered in the wrong location without this patch
dnfield
Sep 1, 2021
Author
Member
Err, sorry - without this change, there'd be no OpacityLayer
, the PictureLayer
would be the firstChild
of rootLayer
.
Err, sorry - without this change, there'd be no OpacityLayer
, the PictureLayer
would be the firstChild
of rootLayer
.
xu-baolin
Sep 1, 2021
Member
It passes with the latest master branch.
It passes with the latest master branch.
dnfield
Sep 1, 2021
Author
Member
Ahh you are right. This would need to test that the add to scene does the right thing. But the golden test does that without getting into such implementation details. I'll remove this test.
Ahh you are right. This would need to test that the add to scene does the right thing. But the golden test does that without getting into such implementation details. I'll remove this test.
xu-baolin
Sep 1, 2021
Member
It isn't bad to remain this ^^
It isn't bad to remain this ^^
fixes #89255
fixes #71008
Now, instead of dropping the opacity layer when it is either disabled or the value is opaque, it uses an OffsetLayer instead. This avoids some of the memory regression from #83145, because the engine special cases
OpacityLayers
to always raster cache them, but does not do quite the same withOffsetLayers
.I did see some regression on mean/median on the internal benchmark, but overall the values are still within the range of the change without this PR.
/cc @xster