-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f97932b
commit 351fc9c
Showing
8 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// CGContext.swift | ||
// Silica | ||
// | ||
// Created by Alsey Coleman Miller on 10/5/16. | ||
// Copyright © 2016 PureSwift. All rights reserved. | ||
// | ||
|
||
/// CoreGraphics compatible wrapper for `Silica.Context`. | ||
public final class CGContextWrapper { | ||
|
||
public let silicaContext: Silica.Context | ||
|
||
public init(_ context: Silica.Context) { | ||
|
||
self.silicaContext = context | ||
} | ||
|
||
@inline(__always) | ||
public func beginTransparencyLayer(auxiliaryInfo: [String: Any]?) { | ||
|
||
try! silicaContext.beginTransparencyLayer() | ||
} | ||
|
||
@inline(__always) | ||
public func endTransparencyLayer() { | ||
|
||
try! silicaContext.endTransparencyLayer() | ||
} | ||
|
||
@inline(__always) | ||
public func saveGState() { | ||
|
||
try! silicaContext.save() | ||
} | ||
|
||
@inline(__always) | ||
public func restoreGState() { | ||
|
||
try! silicaContext.restore() | ||
} | ||
|
||
@inline(__always) | ||
public func clip(to rect: CGRect) { | ||
|
||
silicaContext.clip(to: rect) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Xcode/Silica/Silica.xcodeproj/xcshareddata/xcschemes/Silica.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters