aboutsummaryrefslogtreecommitdiff
path: root/src/osx/graphics/quartz/Image.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-30 20:44:57 +0800
committercrupest <crupest@outlook.com>2022-01-30 20:44:57 +0800
commit1909ee98b92ea993e6fbbdb628da0cf586db7d52 (patch)
treedff1225c2e541e0ba608e5c07699ce9645c5bc0c /src/osx/graphics/quartz/Image.cpp
parentc1f8ea13524f398f8d1720e5f03a17dd66352ebf (diff)
downloadcru-1909ee98b92ea993e6fbbdb628da0cf586db7d52.tar.gz
cru-1909ee98b92ea993e6fbbdb628da0cf586db7d52.tar.bz2
cru-1909ee98b92ea993e6fbbdb628da0cf586db7d52.zip
...
Diffstat (limited to 'src/osx/graphics/quartz/Image.cpp')
-rw-r--r--src/osx/graphics/quartz/Image.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osx/graphics/quartz/Image.cpp b/src/osx/graphics/quartz/Image.cpp
new file mode 100644
index 00000000..901b3ff4
--- /dev/null
+++ b/src/osx/graphics/quartz/Image.cpp
@@ -0,0 +1,16 @@
+#include "cru/osx/graphics/quartz/Image.hpp"
+
+namespace cru::platform::graphics::osx::quartz {
+QuartzImage::QuartzImage(IGraphicsFactory* graphics_factory,
+ IImageFactory* image_factory, CGImageRef image,
+ bool auto_release)
+ : OsxQuartzResource(graphics_factory),
+ image_(image),
+ auto_release_(auto_release) {}
+
+QuartzImage::~QuartzImage() {
+ if (auto_release_) {
+ CGImageRelease(image_);
+ }
+}
+} // namespace cru::platform::graphics::osx::quartz