aboutsummaryrefslogtreecommitdiff
path: root/src/osx/graphics/quartz
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-10-16 23:00:33 +0800
committercrupest <crupest@outlook.com>2021-10-16 23:00:33 +0800
commit44f24f8ece48fd4acc2e8d5f5a052cbc1981768c (patch)
tree82598657107e3972bca357eb40484e676d9ec365 /src/osx/graphics/quartz
parente9f586071a83b2551dbc7c98ccfaa8e6b3189f01 (diff)
downloadcru-44f24f8ece48fd4acc2e8d5f5a052cbc1981768c.tar.gz
cru-44f24f8ece48fd4acc2e8d5f5a052cbc1981768c.tar.bz2
cru-44f24f8ece48fd4acc2e8d5f5a052cbc1981768c.zip
...
Diffstat (limited to 'src/osx/graphics/quartz')
-rw-r--r--src/osx/graphics/quartz/Painter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osx/graphics/quartz/Painter.cpp b/src/osx/graphics/quartz/Painter.cpp
index 4771ca47..041184c6 100644
--- a/src/osx/graphics/quartz/Painter.cpp
+++ b/src/osx/graphics/quartz/Painter.cpp
@@ -8,6 +8,7 @@
namespace cru::platform::graphics::osx::quartz {
QuartzCGContextPainter::~QuartzCGContextPainter() {
+ EndDraw();
if (auto_release_) {
CGContextRelease(cg_context_);
cg_context_ = nullptr;
@@ -108,7 +109,12 @@ void QuartzCGContextPainter::PopLayer() {
// TODO: Implement this.
}
-void QuartzCGContextPainter::EndDraw() { CGContextFlush(cg_context_); }
+void QuartzCGContextPainter::EndDraw() {
+ if (cg_context_) {
+ CGContextFlush(cg_context_);
+ CGContextSynchronize(cg_context_);
+ }
+}
void QuartzCGContextPainter::Validate() {
if (cg_context_ == nullptr)