Browse Source

Changed Skia OpenGL bitmap origin to bottom left.

José Pedro 3 years ago
parent
commit
2c39f80f9b

+ 1 - 1
samples/ControlCatalog/Pages/OpenGlPage.xaml.cs

@@ -345,7 +345,7 @@ namespace ControlCatalog.Pages
                     0.01f, 1000);
 
 
-            var view = Matrix4x4.CreateLookAt(new Vector3(25, 25, 25), new Vector3(), new Vector3(0, -1, 0));
+            var view = Matrix4x4.CreateLookAt(new Vector3(25, 25, 25), new Vector3(), new Vector3(0, 1, 0));
             var model = Matrix4x4.CreateFromYawPitchRoll(_yaw, _pitch, _roll);
             var modelLoc = GL.GetUniformLocationString(_shaderProgram, "uModel");
             var viewLoc = GL.GetUniformLocationString(_shaderProgram, "uView");

+ 1 - 1
src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs

@@ -41,7 +41,7 @@ namespace Avalonia.Skia
                         new GRGlTextureInfo(
                             GlConsts.GL_TEXTURE_2D, (uint)_surface.GetTextureId(),
                             (uint)_surface.InternalFormat)))
-                    using (var surface = SKSurface.Create(context.GrContext, backendTexture, GRSurfaceOrigin.TopLeft,
+                    using (var surface = SKSurface.Create(context.GrContext, backendTexture, GRSurfaceOrigin.BottomLeft,
                         SKColorType.Rgba8888))
                     {
                         // Again, silently ignore, if something went wrong it's not our fault