зеркало из https://github.com/mono/SkiaSharp.git
added the GL view to the mac sample
This commit is contained in:
Родитель
b51ac85fa9
Коммит
7f8a09e946
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using AppKit;
|
using AppKit;
|
||||||
using CoreGraphics;
|
using CoreGraphics;
|
||||||
using Foundation;
|
using Foundation;
|
||||||
|
@ -13,7 +14,7 @@ namespace BasicSkiaSharp
|
||||||
|
|
||||||
private NSView softwareSkiaLayerView;
|
private NSView softwareSkiaLayerView;
|
||||||
|
|
||||||
//private MyHardwareView hardwareSkiaView;
|
private MyHardwareView hardwareSkiaView;
|
||||||
|
|
||||||
//private SKGLLayer hardwareSkiaLayer;
|
//private SKGLLayer hardwareSkiaLayer;
|
||||||
//private NSView hardwareSkiaLayerView;
|
//private NSView hardwareSkiaLayerView;
|
||||||
|
@ -91,10 +92,9 @@ namespace BasicSkiaSharp
|
||||||
softwareSkiaView = new MySoftwareView();
|
softwareSkiaView = new MySoftwareView();
|
||||||
ContentView.AddSubview(softwareSkiaView);
|
ContentView.AddSubview(softwareSkiaView);
|
||||||
|
|
||||||
//// create a custom hardware view
|
// create a custom hardware view
|
||||||
//hardwareSkiaView = new MyHardwareView();
|
hardwareSkiaView = new MyHardwareView();
|
||||||
//hardwareSkiaView.EnableSetNeedsDisplay = true;
|
ContentView.AddSubview(hardwareSkiaView);
|
||||||
//ContentView.AddSubview(hardwareSkiaView);
|
|
||||||
|
|
||||||
// add a software layer
|
// add a software layer
|
||||||
softwareSkiaLayerView = new NSView();
|
softwareSkiaLayerView = new NSView();
|
||||||
|
@ -144,8 +144,8 @@ namespace BasicSkiaSharp
|
||||||
// the software layer
|
// the software layer
|
||||||
softwareSkiaLayerView.Frame = new CGRect(availableSpace.X, availableSpace.Y + rowHeight, colWidth, rowHeight).Inset(inset, inset);
|
softwareSkiaLayerView.Frame = new CGRect(availableSpace.X, availableSpace.Y + rowHeight, colWidth, rowHeight).Inset(inset, inset);
|
||||||
|
|
||||||
//// the hardware view
|
// the hardware view
|
||||||
//hardwareSkiaView.Frame = new CGRect(availableSpace.X + colWidth, availableSpace.Y, colWidth, rowHeight).Inset(inset, inset);
|
hardwareSkiaView.Frame = new CGRect(availableSpace.X + colWidth, availableSpace.Y, colWidth, rowHeight).Inset(inset, inset);
|
||||||
|
|
||||||
//// the hardware layer
|
//// the hardware layer
|
||||||
//hardwareSkiaLayerView.Frame = new CGRect(availableSpace.X + colWidth, availableSpace.Y + rowHeight, colWidth, rowHeight).Inset(inset, inset);
|
//hardwareSkiaLayerView.Frame = new CGRect(availableSpace.X + colWidth, availableSpace.Y + rowHeight, colWidth, rowHeight).Inset(inset, inset);
|
||||||
|
@ -210,15 +210,15 @@ namespace BasicSkiaSharp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//// the custom view
|
// the custom view
|
||||||
//private class MyHardwareView : SKGLView
|
private class MyHardwareView : SKGLView
|
||||||
//{
|
{
|
||||||
// public override void DrawInSurface(SKSurface surface, GRBackendRenderTargetDesc renderTarget)
|
public override void DrawInSurface(SKSurface surface, GRBackendRenderTargetDesc renderTarget)
|
||||||
// {
|
{
|
||||||
// base.DrawInSurface(surface, renderTarget);
|
base.DrawInSurface(surface, renderTarget);
|
||||||
|
|
||||||
// ViewController.Draw(surface, new SKSize(renderTarget.Width, renderTarget.Height));
|
MainWindow.Draw(surface, new SKSize(renderTarget.Width, renderTarget.Height));
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче