Skip to content

Commit 8d2dd5f

Browse files
committed
Fix frame transition glitches on Windows
1 parent d3913f7 commit 8d2dd5f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Source/NVGSurface.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void NVGSurface::updateWindowContextVisibility()
178178
}
179179
#endif
180180

181-
renderAll();
181+
invalidateAll();
182182
}
183183

184184
void NVGSurface::detachContext()
@@ -206,6 +206,7 @@ void NVGSurface::detachContext()
206206
#else
207207
glContext->detach();
208208
#endif
209+
isRenderingThroughImage = false;
209210
}
210211
}
211212

@@ -241,6 +242,8 @@ bool NVGSurface::makeContextActive()
241242
return getView() != nullptr && nvg != nullptr && mnvgDevice(nvg) != nullptr;
242243
#else
243244
if (glContext && glContext->makeActive()) {
245+
if (renderThroughImage)
246+
updateWindowContextVisibility();
244247
return true;
245248
}
246249

@@ -498,5 +501,5 @@ void NVGSurface::removeBufferedObject(NVGComponent* component)
498501

499502
void NVGSurface::handleCommandMessage(int commandID)
500503
{
501-
blitToScreen();
504+
needsBufferSwap = true;
502505
}

0 commit comments

Comments
 (0)