aboutsummaryrefslogtreecommitdiff
path: root/src/osx/graphics/quartz/Painter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx/graphics/quartz/Painter.cpp')
-rw-r--r--src/osx/graphics/quartz/Painter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/osx/graphics/quartz/Painter.cpp b/src/osx/graphics/quartz/Painter.cpp
index 42f6f1b7..be29310c 100644
--- a/src/osx/graphics/quartz/Painter.cpp
+++ b/src/osx/graphics/quartz/Painter.cpp
@@ -2,6 +2,7 @@
#include "cru/osx/graphics/quartz/Brush.hpp"
#include "cru/osx/graphics/quartz/Convert.hpp"
+#include "cru/osx/graphics/quartz/Geometry.hpp"
#include "cru/platform/Check.hpp"
namespace cru::platform::graphics::osx::quartz {
@@ -46,4 +47,25 @@ void QuartzCGContextPainter::FillRectangle(const Rect& rectangle,
CGContextFillRect(cg_context_, Convert(rectangle));
}
+void QuartzCGContextPainter::StrokeGeometry(IGeometry* geometry, IBrush* brush,
+ float width) {
+ QuartzGeometry* g = CheckPlatform<QuartzGeometry>(geometry, GetPlatformId());
+ QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId());
+
+ b->Select(cg_context_);
+ CGContextSetLineWidth(cg_context_, width);
+ CGContextBeginPath(cg_context_);
+ CGContextAddPath(cg_context_, g->GetCGPath());
+ CGContextStrokePath(cg_context_);
+}
+
+void QuartzCGContextPainter::FillGeometry(IGeometry* geometry, IBrush* brush) {
+ QuartzGeometry* g = CheckPlatform<QuartzGeometry>(geometry, GetPlatformId());
+ QuartzBrush* b = CheckPlatform<QuartzBrush>(brush, GetPlatformId());
+
+ b->Select(cg_context_);
+ CGContextBeginPath(cg_context_);
+ CGContextAddPath(cg_context_, g->GetCGPath());
+ CGContextFillPath(cg_context_);
+}
} // namespace cru::platform::graphics::osx::quartz