SKGLView is much darker than SKCanvasView

My main application screen is displayed through SKCanvasView. The colors accurately reflect the values ​​that I specified in the code.

If I replace SKGLView (hardware accelerated version) without changing any other code, the result is 60% darker:

<!--<skia:SKCanvasView PaintSurface="OnCanvasViewPaintSurface" />--> <skia:SKGLView PaintSurface="OnCanvasViewPaintSurface" /> 

Why is this happening and how to fix it?

+7
xamarin xamarin.forms skiasharp
source share
1 answer

The answer can be found here: https://github.com/mono/SkiaSharp/issues/299#issuecomment-331990904

I found a solution to the problem. There is a special attribute that is set in the splash screen style, but is not canceled (for any reason) when changing the style.

In splashscreen style splashscreen pay attention to this:

 <item name="android:backgroundDimEnabled">true</item> 

Docs: https://developer.xamarin.com/api/field/Android.Resource+Attribute.BackgroundDimEnabled

This does not cancel when switching the style. So, to fix this, just set it to false:

 <item name="android:backgroundDimEnabled">false</item> 

Here is the repository that demonstrates this: https://github.com/mattleibow/AndroidGLSurfaceViewTests

+2
source share

All Articles