1 module skia.SKSurfaceProperties; 2 3 import skia.Definitions; 4 import skia.MathTypes; 5 import skia.SKObject; 6 import skia.SkiaApi; 7 import skia.Util; 8 9 class SKSurfaceProperties : SKObject 10 { 11 this (void* h, bool owns) 12 { 13 super (h, owns); 14 } 15 16 this (SKSurfaceProps props) 17 { 18 // super (props.Flags, props.PixelGeometry); 19 super(cast(void*)0,false); 20 } 21 22 this (SKPixelGeometry pixelGeometry) 23 { 24 super(cast(void*)0,false); 25 } 26 27 this (uint flags, SKPixelGeometry pixelGeometry) 28 { 29 this (SkiaApi.sk_surfaceprops_new (flags, pixelGeometry), true); 30 } 31 32 this (SKSurfacePropsFlags flags, SKPixelGeometry pixelGeometry) 33 { 34 this (SkiaApi.sk_surfaceprops_new (cast(uint)flags, pixelGeometry), true); 35 } 36 37 protected override void Dispose (bool disposing) 38 { 39 return super.Dispose (disposing); 40 } 41 42 43 protected override void DisposeNative () 44 { 45 SkiaApi.sk_surfaceprops_delete (cast(sk_surfaceprops_t*)Handle); 46 } 47 48 49 SKSurfacePropsFlags Flags() 50 { 51 return cast(SKSurfacePropsFlags)SkiaApi.sk_surfaceprops_get_flags (cast(sk_surfaceprops_t*)Handle); 52 } 53 54 55 SKPixelGeometry PixelGeometry() 56 { 57 return SkiaApi.sk_surfaceprops_get_pixel_geometry (cast(sk_surfaceprops_t*)Handle); 58 } 59 60 61 bool IsUseDeviceIndependentFonts() 62 { 63 return Flags.HasFlag (SKSurfacePropsFlags.UseDeviceIndependentFonts); 64 } 65 66 67 static SKSurfaceProperties GetObject (void* handle, bool owns = true) 68 { 69 return GetOrAddObject!(SKSurfaceProperties)(handle, delegate SKSurfaceProperties (h, o) { return new SKSurfaceProperties (h, o);}); 70 // return GetOrAddObject (handle, owns, (h, o){return new SKSurfaceProperties (h, o);}); 71 } 72 73 }