aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-10-02 16:44:32 +0800
committercrupest <crupest@outlook.com>2021-10-02 16:44:32 +0800
commit24a636954a25e938c079d88f48ee01143d667cfb (patch)
tree5901c9a6eb41907976d38401f3617fc30de62052 /include
parentf246877698e5b9aa98e99f3fd3d2247998008695 (diff)
downloadcru-24a636954a25e938c079d88f48ee01143d667cfb.tar.gz
cru-24a636954a25e938c079d88f48ee01143d667cfb.tar.bz2
cru-24a636954a25e938c079d88f48ee01143d667cfb.zip
...
Diffstat (limited to 'include')
-rw-r--r--include/cru/osx/graphics/quartz/Convert.hpp6
-rw-r--r--include/cru/osx/graphics/quartz/Painter.hpp15
2 files changed, 19 insertions, 2 deletions
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)
@@ -44,6 +48,13 @@ 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