Closed adrinieto closed 4 months ago
In case it helps, to make BlendMode.SrcIn
work in Compose .graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen)
is also needed. But the result is the same with Roborazzi.
Cloud you try to use hardware rendering mode? https://github.com/takahirom/roborazzi/issues/255#issuecomment-1972838571
Thanks for your fast response. It works! 🙌
Should we enable this flag for all the project? Or only for specific screens? I see it also solves issues with elevations, shadows, and gradients. I guess there are some side effects and that's why it's not enabled by default.
Good question! I think you can check this issue. I think we can enable the flag in the next Robolectric version for all projects https://github.com/takahirom/roborazzi/issues/296
When using
Modifier.drawWithContent
andBlendMode.BlendMode.SrcIn
I get a different result than in a real device or emulator. For example, this is the Compose code to build a partially filled star icon:Here are some results I got using the sample Android app in
ComposeTest
.If I use
createComposeRule
, that internally uses aComponentActivity
I get a square image.But, If I use
RoborazziTransparentActivity
it works.After further investigation, it seems related with the
colorBackground
. It only works with a transparent background:When used in Compose Previews it works as expected, so I'm not sure what's going on.
Is this a problem of Roborazzi or a limitation of using Layoutlib?
Thanks in advance.