Example #1
0
        protected virtual void OnPaintSurface(SKPaintSurfaceEventArgs e)
        {
            // invoke the event
            PaintSurface?.Invoke(this, e);

            p8SkiaLayout.OnCanvasViewPaintSurface(this, e);
        }
Example #2
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            Title = $"(Vsync: {VSync}) FPS: {1f / e.Time:0}";

            var props = new SKSurfaceProperties(SKSurfacePropsFlags.None, SKPixelGeometry.BgrHorizontal);

            using (var surface = SKSurface.Create(_context, _renderTarget, SKColorType.Bgra8888, props))
            {
                if (surface != null)
                {
                    Debug.Assert(surface != null);
                    Debug.Assert(surface.Handle != IntPtr.Zero);

                    var canvas = surface.Canvas;

                    canvas.Flush();

                    var info = this._renderTarget;

                    PaintSurface?.Invoke(this, new SKPaintGLSurfaceEventArgs(surface, _renderTarget));

                    canvas.Flush();
                }
                else
                {
                }
            }

            this._context.Flush();
            SwapBuffers();
        }
 public virtual void DrawInSurface(SKSurface surface, GRBackendRenderTargetDesc renderTarget)
 {
     if (PaintSurface != null)
     {
         PaintSurface.Invoke(this, new SKPaintGLSurfaceEventArgs(surface, renderTarget));
     }
 }
Example #4
0
 protected virtual void OnPaintSurface(SKPaintGLSurfaceEventArgs e)
 {
     if (PaintSurface != null)
     {
         PaintSurface.Invoke(this, e);
     }
 }
Example #5
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            Title = $"(Vsync: {VSync}) FPS: {1f / e.Time:0}";

            this.renderTarget.Width  = this.Width;
            this.renderTarget.Height = this.Height;

            var props = new SKSurfaceProps
            {
                Flags         = SKSurfacePropsFlags.None,
                PixelGeometry = SKPixelGeometry.RgbHorizontal
            };

            using (var surface = SKSurface.Create(this.context, this.renderTarget))
            {
                Debug.Assert(surface != null);
                Debug.Assert(surface.Handle != IntPtr.Zero);

                var canvas = surface.Canvas;

                canvas.Flush();

                var info = this.renderTarget;

                PaintSurface?.Invoke(this, new SKPaintGLSurfaceEventArgs(surface, renderTarget));

                canvas.Flush();
            }

            this.context.Flush();
            SwapBuffers();
        }
Example #6
0
 protected virtual void OnPaintSurface(SKPaintGLSurfaceEventArgs e)
 {
     PaintSurface?.Invoke(this, e);
 }
Example #7
0
 protected virtual void OnPaintSurface(SKPaintSurfaceEventArgs e)
 {
     // invoke the event
     PaintSurface?.Invoke(this, e);
 }
Example #8
0
 public virtual void DrawInSurface(SKSurface surface, SKImageInfo info)
 {
     PaintSurface?.Invoke(this, new SKPaintSurfaceEventArgs(surface, info));
 }
Example #9
0
 protected virtual void OnDraw(SKSurface surface, SKImageInfo info)
 {
     PaintSurface?.Invoke(this, new SKPaintSurfaceEventArgs(surface, info));
 }
Example #10
0
 protected virtual void OnDrawFrame(SKPaintSurfaceEventArgs e)
 {
     PaintSurface?.Invoke(this, e);
 }
Example #11
0
 protected void SendPaintSurface(SKPaintSurfaceEventArgs e)
 {
     PaintSurface?.Invoke(this, e);
 }
Example #12
0
 public void OnDrawFrame(SKSurface surface, GRBackendRenderTargetDesc renderTarget)
 {
     PaintSurface?.Invoke(surface, renderTarget);
 }
Example #13
0
        public override void Draw(Canvas canvas)
        {
            base.Draw(canvas);

            PaintSurface?.Invoke(this, canvas);
        }
Example #14
0
 protected virtual void OnDrawFrame(SKSurface surface, GRBackendRenderTargetDesc renderTarget)
 {
     PaintSurface?.Invoke(this, new SKPaintGLSurfaceEventArgs(surface, renderTarget));
 }