You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CGContext is a drawing canvas. We can use it to render fonts, convert 32bit PNGs to 8bit Alpha maps etc.
Implementation
The easiest method available to us is to make CGContext a thin wrapper over SDLSurface - both have similar initialisers, properties, and methods. And a SDLSurface can be easily converted to a CGImage (as can a CGContext). If we need more advanced drawing capabilities (rounded circles etc) we can use (lib) Cairo to draw on the SDLSurface internally.
This work has been done in Cacao: https://github.com/PureSwift/Cacao. @colemancda has indicated to us that it'd be fine to use the implementation he implemented using Cairo, we "just" need to build Cairo for Android and adapt his internal UIKit code to match our structures.
The text was updated successfully, but these errors were encountered:
The actual code is here: https://github.com/PureSwift/Silica CoreGraphics is actually one of the really solid parts of the Cacao project. You need the get Cairo compiling via the SwiftPM or an Android binary.
CGContext
is a drawing canvas. We can use it to render fonts, convert 32bit PNGs to 8bit Alpha maps etc.Implementation
The easiest method available to us is to make CGContext a thin wrapper over SDLSurface - both have similar initialisers, properties, and methods. And a
SDLSurface
can be easily converted to aCGImage
(as can aCGContext
). If we need more advanced drawing capabilities (rounded circles etc) we can use (lib) Cairo to draw on theSDLSurface
internally.This work has been done in Cacao: https://github.com/PureSwift/Cacao. @colemancda has indicated to us that it'd be fine to use the implementation he implemented using Cairo, we "just" need to build Cairo for Android and adapt his internal UIKit code to match our structures.
The text was updated successfully, but these errors were encountered: