diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/osx/graphics/quartz/Brush.cpp | 9 | ||||
-rw-r--r-- | src/osx/graphics/quartz/Factory.cpp | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/osx/graphics/quartz/Brush.cpp b/src/osx/graphics/quartz/Brush.cpp index a930719c..6e4893b1 100644 --- a/src/osx/graphics/quartz/Brush.cpp +++ b/src/osx/graphics/quartz/Brush.cpp @@ -18,4 +18,13 @@ void QuartzSolidColorBrush::SetColor(const Color& color) { CGColorCreateGenericRGB(color.GetFloatRed(), color.GetFloatGreen(), color.GetFloatBlue(), color.GetFloatAlpha()); } + +void QuartzSolidColorBrush::Select(CGContextRef context) { + CGContextSaveGState(context); + + CGContextSetStrokeColorWithColor(context, cg_color_); + CGContextSetFillColorWithColor(context, cg_color_); + + CGContextRestoreGState(context); +} } // namespace cru::platform::graphics::osx::quartz diff --git a/src/osx/graphics/quartz/Factory.cpp b/src/osx/graphics/quartz/Factory.cpp index f9b792f2..72dd96c7 100644 --- a/src/osx/graphics/quartz/Factory.cpp +++ b/src/osx/graphics/quartz/Factory.cpp @@ -1 +1,12 @@ #include "cru/osx/graphics/quartz/Factory.hpp" + +#include "cru/osx/graphics/quartz/Brush.hpp" + +#include <memory> + +namespace cru::platform::graphics::osx::quartz { +std::unique_ptr<ISolidColorBrush> +QuartzGraphicsFactory::CreateSolidColorBrush() { + return std::make_unique<QuartzSolidColorBrush>(this, colors::black); +} +} // namespace cru::platform::graphics::osx::quartz |