From 24a636954a25e938c079d88f48ee01143d667cfb Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 2 Oct 2021 16:44:32 +0800 Subject: ... --- include/cru/osx/graphics/quartz/Convert.hpp | 6 ++++++ include/cru/osx/graphics/quartz/Painter.hpp | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'include/cru/osx/graphics/quartz') diff --git a/include/cru/osx/graphics/quartz/Convert.hpp b/include/cru/osx/graphics/quartz/Convert.hpp index f85fc20e..a8cc270e 100644 --- a/include/cru/osx/graphics/quartz/Convert.hpp +++ b/include/cru/osx/graphics/quartz/Convert.hpp @@ -12,6 +12,12 @@ String Convert(CFStringRef string); CGAffineTransform Convert(const Matrix& matrix); Matrix Convert(const CGAffineTransform& matrix); +CGPoint Convert(const Point& point); +Point Convert(const CGPoint& point); + +CGSize Convert(const Size& size); +Size Convert(const CGSize& size); + CGRect Convert(const Rect& rect); Rect Convert(const CGRect& rect); diff --git a/include/cru/osx/graphics/quartz/Painter.hpp b/include/cru/osx/graphics/quartz/Painter.hpp index 9a3df187..715cc364 100644 --- a/include/cru/osx/graphics/quartz/Painter.hpp +++ b/include/cru/osx/graphics/quartz/Painter.hpp @@ -11,8 +11,12 @@ class QuartzCGContextPainter : public OsxQuartzResource, public virtual IPainter { public: explicit QuartzCGContextPainter(IGraphicsFactory* graphics_factory, - CGContextRef cg_context) - : OsxQuartzResource(graphics_factory), cg_context_(cg_context) {} + CGContextRef cg_context, bool auto_release, + const Size& size) + : OsxQuartzResource(graphics_factory), + cg_context_(cg_context), + auto_release_(auto_release), + size_(size) {} CRU_DELETE_COPY(QuartzCGContextPainter) CRU_DELETE_MOVE(QuartzCGContextPainter) @@ -43,7 +47,14 @@ class QuartzCGContextPainter : public OsxQuartzResource, void EndDraw() override; + private: + void Validate(); + private: CGContextRef cg_context_; + + bool auto_release_; + + Size size_; }; } // namespace cru::platform::graphics::osx::quartz -- cgit v1.2.3