diff options
author | crupest <crupest@outlook.com> | 2021-10-16 23:00:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-10-16 23:00:33 +0800 |
commit | 44f24f8ece48fd4acc2e8d5f5a052cbc1981768c (patch) | |
tree | 82598657107e3972bca357eb40484e676d9ec365 /src/osx/graphics/quartz | |
parent | e9f586071a83b2551dbc7c98ccfaa8e6b3189f01 (diff) | |
download | cru-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.cpp | 8 |
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) |