Added an Mac OS OpenGL sample
15
build.cake
|
@ -868,6 +868,10 @@ Task ("samples")
|
|||
c.Configuration = "Release";
|
||||
c.Properties ["Platform"] = new [] { "iPhoneSimulator" };
|
||||
});
|
||||
RunNuGetRestore ("./samples/Skia.OSX.GLDemo/Skia.OSX.GLDemo.sln");
|
||||
DotNetBuild ("./samples/Skia.OSX.GLDemo/Skia.OSX.GLDemo.sln", c => {
|
||||
c.Configuration = "Release";
|
||||
});
|
||||
}
|
||||
|
||||
if (IsRunningOnWindows ()) {
|
||||
|
@ -884,6 +888,11 @@ Task ("samples")
|
|||
DotNetBuild ("./samples/Skia.Forms.Demo/Skia.Forms.Demo.Windows.sln", c => {
|
||||
c.Configuration = "Release";
|
||||
});
|
||||
RunNuGetRestore ("./samples/Skia.WindowsDesktop.GLDemo/Skia.WindowsDesktop.GLDemo.sln");
|
||||
DotNetBuild ("./samples/Skia.WindowsDesktop.GLDemo/Skia.WindowsDesktop.GLDemo.sln", c => {
|
||||
c.Configuration = "Release";
|
||||
c.Properties ["Platform"] = new [] { "x86" };
|
||||
});
|
||||
}
|
||||
|
||||
RunNuGetRestore ("./samples/Skia.WindowsDesktop.Demo/Skia.WindowsDesktop.Demo.sln");
|
||||
|
@ -891,12 +900,6 @@ Task ("samples")
|
|||
c.Configuration = "Release";
|
||||
c.Properties ["Platform"] = new [] { "x86" };
|
||||
});
|
||||
|
||||
RunNuGetRestore ("./samples/Skia.WindowsDesktop.GLDemo/Skia.WindowsDesktop.GLDemo.sln");
|
||||
DotNetBuild ("./samples/Skia.WindowsDesktop.GLDemo/Skia.WindowsDesktop.GLDemo.sln", c => {
|
||||
c.Configuration = "Release";
|
||||
c.Properties ["Platform"] = new [] { "x86" };
|
||||
});
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
using AppKit;
|
||||
using Foundation;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
[Register ("AppDelegate")]
|
||||
public partial class AppDelegate : NSApplicationDelegate
|
||||
{
|
||||
public AppDelegate ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void DidFinishLaunching (NSNotification notification)
|
||||
{
|
||||
// Insert code here to initialize your application
|
||||
}
|
||||
|
||||
public override void WillTerminate (NSNotification notification)
|
||||
{
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Xamarin Studio to store outlets and
|
||||
// actions made in the UI designer. If it is removed, they will be lost.
|
||||
// Manual changes to this file may not be handled correctly.
|
||||
//
|
||||
using Foundation;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
partial class AppDelegate
|
||||
{
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>Skia.OSX.Demo</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.skia-osx-demo</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.10</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>billholmes</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
|
||||
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,13 @@
|
|||
using AppKit;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
static class MainClass
|
||||
{
|
||||
static void Main (string[] args)
|
||||
{
|
||||
NSApplication.Init ();
|
||||
NSApplication.Main (args);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="Skia.OSX.Demo" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Skia.OSX.Demo" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About Skia.OSX.Demo" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eHP-pT-vMg"/>
|
||||
<menuItem title="Quit Skia.OSX.Demo" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="0.0"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
|
||||
<customView key="view" id="QUA-QF-Q3f">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<view translatesAutoresizingMaskIntoConstraints="NO" id="m2S-Jp-Qdl" customClass="SkiaView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
|
||||
</view>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mnJ-8z-WRI">
|
||||
<rect key="frame" x="228" y="17" width="205" height="26"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="200" id="3Ya-mE-NFc"/>
|
||||
<constraint firstAttribute="height" constant="21" id="PW1-2o-QII"/>
|
||||
</constraints>
|
||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="5te-c2-WKW">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="LKv-bG-q8C"/>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="PopUpButtonAction:" target="XfG-lQ-9wD" id="lmM-6c-sIb"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="mnJ-8z-WRI" secondAttribute="bottom" constant="20" id="A3L-Bb-rlF"/>
|
||||
<constraint firstAttribute="trailing" secondItem="mnJ-8z-WRI" secondAttribute="trailing" constant="20" id="DYI-UX-Zkb"/>
|
||||
<constraint firstAttribute="bottom" secondItem="m2S-Jp-Qdl" secondAttribute="bottom" id="Gw9-r7-0Df"/>
|
||||
<constraint firstItem="m2S-Jp-Qdl" firstAttribute="top" secondItem="QUA-QF-Q3f" secondAttribute="top" id="Uut-tC-oBU"/>
|
||||
<constraint firstItem="m2S-Jp-Qdl" firstAttribute="leading" secondItem="QUA-QF-Q3f" secondAttribute="leading" id="Xcr-Wg-5ia"/>
|
||||
<constraint firstAttribute="trailing" secondItem="m2S-Jp-Qdl" secondAttribute="trailing" id="rZp-9d-Lpb"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<connections>
|
||||
<outlet property="PopUpButton" destination="mnJ-8z-WRI" id="mEQ-lK-fod"/>
|
||||
<outlet property="SkiaView" destination="m2S-Jp-Qdl" id="8ta-WW-AHG"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="655"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-128.png
Normal file
После Ширина: | Высота: | Размер: 7.9 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-128@2x.png
Normal file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-16.png
Normal file
После Ширина: | Высота: | Размер: 711 B |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-16@2x.png
Normal file
После Ширина: | Высота: | Размер: 1.4 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-256.png
Normal file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-256@2x.png
Normal file
После Ширина: | Высота: | Размер: 58 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-32.png
Normal file
После Ширина: | Высота: | Размер: 1.4 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-32@2x.png
Normal file
После Ширина: | Высота: | Размер: 3.3 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-512.png
Normal file
После Ширина: | Высота: | Размер: 58 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-512@2x.png
Normal file
После Ширина: | Высота: | Размер: 174 KiB |
|
@ -0,0 +1,222 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "57x57",
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "57x57",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "83.5x83.5",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"role": "notificationCenter",
|
||||
"size": "24x24",
|
||||
"subtype": "38mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "notificationCenter",
|
||||
"size": "27.5x27.5",
|
||||
"subtype": "42mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "companionSettings",
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "companionSettings",
|
||||
"size": "29x29",
|
||||
"scale": "3x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "appLauncher",
|
||||
"size": "40x40",
|
||||
"subtype": "38mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "longLook",
|
||||
"size": "44x44",
|
||||
"subtype": "42mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "quickLook",
|
||||
"size": "86x86",
|
||||
"subtype": "38mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "quickLook",
|
||||
"size": "98x98",
|
||||
"subtype": "42mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"filename": "skia_16x16.png",
|
||||
"size": "16x16",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_32x32.png",
|
||||
"size": "16x16",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_32x32.png",
|
||||
"size": "32x32",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_64x64.png",
|
||||
"size": "32x32",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_128x128.png",
|
||||
"size": "128x128",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_256x256.png",
|
||||
"size": "128x128",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_256x256.png",
|
||||
"size": "256x256",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_512x512.png",
|
||||
"size": "256x256",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_512x512.png",
|
||||
"size": "512x512",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"filename": "skia_1024x1024.png",
|
||||
"size": "512x512",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_1024x1024.png
Normal file
После Ширина: | Высота: | Размер: 28 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_128x128.png
Normal file
После Ширина: | Высота: | Размер: 3.1 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_16x16.png
Normal file
После Ширина: | Высота: | Размер: 935 B |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_256x256.png
Normal file
После Ширина: | Высота: | Размер: 5.9 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_32x32.png
Normal file
После Ширина: | Высота: | Размер: 1.5 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_512x512.png
Normal file
После Ширина: | Высота: | Размер: 13 KiB |
Двоичные данные
samples/Skia.OSX.GLDemo/Resources/Images.xcassets/AppIcons.appiconset/skia_64x64.png
Normal file
После Ширина: | Высота: | Размер: 2.7 KiB |
|
@ -0,0 +1,130 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{1730229c-f631-4ba9-86b3-d62828d8815b}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Skia.OSX.GLDemo</RootNamespace>
|
||||
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
|
||||
<AssemblyName>Skia.OSX.GLDemo</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<Profiling>true</Profiling>
|
||||
<UseRefCounting>true</UseRefCounting>
|
||||
<UseSGen>true</UseSGen>
|
||||
<IncludeMonoRuntime>false</IncludeMonoRuntime>
|
||||
<CreatePackage>false</CreatePackage>
|
||||
<CodeSigningKey>Mac Developer</CodeSigningKey>
|
||||
<EnableCodeSigning>false</EnableCodeSigning>
|
||||
<EnablePackageSigning>false</EnablePackageSigning>
|
||||
<XamMacArch>x86_64</XamMacArch>
|
||||
<PackageSigningKey>Developer ID Installer</PackageSigningKey>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<Profiling>false</Profiling>
|
||||
<UseRefCounting>true</UseRefCounting>
|
||||
<UseSGen>true</UseSGen>
|
||||
<IncludeMonoRuntime>true</IncludeMonoRuntime>
|
||||
<CreatePackage>true</CreatePackage>
|
||||
<CodeSigningKey>Mac Developer</CodeSigningKey>
|
||||
<EnableCodeSigning>true</EnableCodeSigning>
|
||||
<EnablePackageSigning>false</EnablePackageSigning>
|
||||
<XamMacArch>x86_64</XamMacArch>
|
||||
<LinkMode>Full</LinkMode>
|
||||
<PackageSigningKey>Developer ID Installer</PackageSigningKey>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.Mac" />
|
||||
<Reference Include="SkiaSharp">
|
||||
<HintPath>packages\SkiaSharp.1.53.1.1-gpu-preview1\lib\XamarinMac\SkiaSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-128.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-128%402x.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-16.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-16%402x.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-256.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-256%402x.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-32.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-32%402x.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-512.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\AppIcon-512%402x.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_16x16.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_32x32.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_64x64.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_128x128.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_256x256.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_512x512.png" />
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\skia_1024x1024.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="ViewController.cs" />
|
||||
<Compile Include="ViewController.designer.cs">
|
||||
<DependentUpon>ViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SkiaView.cs" />
|
||||
<Compile Include="SkiaView.designer.cs">
|
||||
<DependentUpon>SkiaView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="AppDelegate.designer.cs">
|
||||
<DependentUpon>AppDelegate.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="..\SharedDemo\SkiaSharp.Demos.cs">
|
||||
<Link>SkiaSharp.Demos.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Main.storyboard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\SharedDemo\embedded-font.ttf">
|
||||
<Link>embedded-font.ttf</Link>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="..\SharedDemo\baboon.png">
|
||||
<Link>baboon.png</Link>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="..\SharedDemo\color-wheel.png">
|
||||
<Link>color-wheel.png</Link>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="..\SharedDemo\adobe-dng.dng">
|
||||
<Link>adobe-dng.dng</Link>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="..\SharedDemo\content-font.ttf">
|
||||
<Link>Resources\content-font.ttf</Link>
|
||||
</BundleResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
|
||||
<Import Project="packages\SkiaSharp.1.53.1.1-gpu-preview1\build\XamarinMac\SkiaSharp.targets" Condition="Exists('packages\SkiaSharp.1.53.1.1-gpu-preview1\build\XamarinMac\SkiaSharp.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Skia.OSX.GLDemo", "Skia.OSX.GLDemo.csproj", "{1730229c-f631-4ba9-86b3-d62828d8815b}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1730229c-f631-4ba9-86b3-d62828d8815b}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1730229c-f631-4ba9-86b3-d62828d8815b}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1730229c-f631-4ba9-86b3-d62828d8815b}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1730229c-f631-4ba9-86b3-d62828d8815b}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using AppKit;
|
||||
using OpenTK.Graphics.OpenGL;
|
||||
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
public partial class SkiaView : NSOpenGLView
|
||||
{
|
||||
Demos.Sample sample;
|
||||
|
||||
GRContext grContext;
|
||||
|
||||
public SkiaView (IntPtr handle) : base (handle)
|
||||
{
|
||||
AddGestureRecognizer (new NSClickGestureRecognizer (OnClicked));
|
||||
}
|
||||
|
||||
public override void PrepareOpenGL ()
|
||||
{
|
||||
base.PrepareOpenGL ();
|
||||
|
||||
grContext = GRContext.Create (GRBackend.OpenGL);
|
||||
}
|
||||
|
||||
public override void DrawRect (CoreGraphics.CGRect dirtyRect)
|
||||
{
|
||||
base.DrawRect (dirtyRect);
|
||||
|
||||
if (grContext != null)
|
||||
{
|
||||
var sampleCount = grContext.GetRecommendedSampleCount(GRPixelConfig.Rgba8888, 96.0f);
|
||||
|
||||
var desc = new GRBackendRenderTargetDesc
|
||||
{
|
||||
Width = (int)Bounds.Width,
|
||||
Height = (int)Bounds.Height,
|
||||
Config = GRPixelConfig.Rgba8888,
|
||||
Origin = GRSurfaceOrigin.TopLeft,
|
||||
SampleCount = sampleCount,
|
||||
StencilBits = 0,
|
||||
RenderTargetHandle = IntPtr.Zero,
|
||||
};
|
||||
|
||||
using (var surface = SKSurface.Create (grContext, desc))
|
||||
{
|
||||
var skcanvas = surface.Canvas;
|
||||
|
||||
sample.Method (skcanvas, (int)Bounds.Width, (int)Bounds.Height);
|
||||
|
||||
skcanvas.Flush ();
|
||||
}
|
||||
|
||||
GL.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
void OnClicked ()
|
||||
{
|
||||
Sample?.TapMethod?.Invoke ();
|
||||
}
|
||||
|
||||
public Demos.Sample Sample {
|
||||
get {
|
||||
return sample;
|
||||
}
|
||||
set {
|
||||
sample = value;
|
||||
SetNeedsDisplayInRect (Bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Xamarin Studio to store outlets and
|
||||
// actions made in the UI designer. If it is removed, they will be lost.
|
||||
// Manual changes to this file may not be handled correctly.
|
||||
//
|
||||
using Foundation;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
[Register ("SkiaView")]
|
||||
partial class SkiaView
|
||||
{
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
|
||||
using AppKit;
|
||||
using Foundation;
|
||||
using System.IO;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
public partial class ViewController : NSViewController
|
||||
{
|
||||
public ViewController (IntPtr handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
|
||||
// set up resource paths
|
||||
string fontName = "content-font.ttf";
|
||||
SkiaSharp.Demos.CustomFontPath = NSBundle.MainBundle.PathForResource (Path.GetFileNameWithoutExtension (fontName), Path.GetExtension (fontName));
|
||||
var dir = Path.Combine (Path.GetTempPath (), "SkiaSharp.Demos", Path.GetRandomFileName ());
|
||||
if (!Directory.Exists (dir))
|
||||
{
|
||||
Directory.CreateDirectory (dir);
|
||||
}
|
||||
SkiaSharp.Demos.WorkingDirectory = dir;
|
||||
SkiaSharp.Demos.OpenFileDelegate = path =>
|
||||
{
|
||||
if (!NSWorkspace.SharedWorkspace.OpenFile (Path.Combine (dir, path)))
|
||||
{
|
||||
NSAlert.WithMessage ("SkiaSharp", "OK", null, null, "Unable to open file.").RunSheetModal (View.Window);
|
||||
}
|
||||
};
|
||||
|
||||
PopUpButton.AddItems (SkiaSharp.Demos.SamplesForPlatform (SkiaSharp.Demos.Platform.OSX | SkiaSharp.Demos.Platform.OpenGL));
|
||||
PopUpButton.SelectItem (0);
|
||||
SkiaView.Sample = SkiaSharp.Demos.GetSample (PopUpButton.SelectedItem.Title);
|
||||
}
|
||||
|
||||
partial void PopUpButtonAction (NSObject sender)
|
||||
{
|
||||
SkiaView.Sample = SkiaSharp.Demos.GetSample (PopUpButton.SelectedItem.Title);
|
||||
}
|
||||
|
||||
public override NSObject RepresentedObject {
|
||||
get {
|
||||
return base.RepresentedObject;
|
||||
}
|
||||
set {
|
||||
base.RepresentedObject = value;
|
||||
// Update the view, if already loaded.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Xamarin Studio to store outlets and
|
||||
// actions made in the UI designer. If it is removed, they will be lost.
|
||||
// Manual changes to this file may not be handled correctly.
|
||||
//
|
||||
using Foundation;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace Skia.OSX.Demo
|
||||
{
|
||||
[Register ("ViewController")]
|
||||
partial class ViewController
|
||||
{
|
||||
[Outlet]
|
||||
AppKit.NSPopUpButton PopUpButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
Skia.OSX.Demo.SkiaView SkiaView { get; set; }
|
||||
|
||||
[Action ("PopUpButtonAction:")]
|
||||
partial void PopUpButtonAction (Foundation.NSObject sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (PopUpButton != null) {
|
||||
PopUpButton.Dispose ();
|
||||
PopUpButton = null;
|
||||
}
|
||||
|
||||
if (SkiaView != null) {
|
||||
SkiaView.Dispose ();
|
||||
SkiaView = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="SkiaSharp" version="1.53.1.1-gpu-preview1" targetFramework="xamarinmac20" />
|
||||
</packages>
|