diff options
Diffstat (limited to 'src/osx/graphics/quartz/Painter.cpp')
-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) |