-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The Flutter framework and dart:ui has methods called PaintingContext.pushOpacity and SceneBuilder.pushOpacity (respectively) used to create opacity layers today. Unfortunately, these methods actually take an alpha. In order to support wider opacity values, we'd like to instead have methods which accept a float/double and avoid int truncation. We have a few advantages, namely that in the corpus of g3 code I've looked at, no one seems to use these methods directly.
-
We could roll a hard breaking change where we change the type of the engine APIs to accept a double, then do a similar change in the framework. This would be disruptive during the landing, but would lead us quickly to an ideal state. Code not in g3 or the SDK would not be migrated, though this could potentially be
dart fix'd since the conversion from alpha to opacity is trivial. -
Alternatively, we could introduce new APIs that do the right thing, and make the old APIs delegate to these new ones along with a deprecation period. Unfortunately its hard to get a better name than
pushOpacity. We'd basically need to introducepushOpacity2. I'm calling itpushOpacityValueright now which is just redundant.
This came up in #102687
Engine change would be: flutter/engine#33035
(We should consider similar changes for color to support wider gamuts )