From 44f24f8ece48fd4acc2e8d5f5a052cbc1981768c Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 16 Oct 2021 23:00:33 +0800 Subject: ... --- src/osx/graphics/quartz/Painter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/osx/graphics/quartz/Painter.cpp') 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) -- cgit v1.2.3