diff options
author | Neil <nyamatongwe@gmail.com> | 2013-11-11 10:25:01 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-11-11 10:25:01 +1100 |
commit | 4bae69ba3c01be59d8918c56c341af78fc09192a (patch) | |
tree | 2c8fc503e8d19e79e317bdd64e2a6dc9be453f03 /win32 | |
parent | 3bb89aada60ce376d1ed4bb496a9ec755334aecc (diff) | |
download | scintilla-mirror-4bae69ba3c01be59d8918c56c341af78fc09192a.tar.gz |
When Direct2D returns D2DERR_RECREATE_TARGET handle by complete redraw instead
of trying to redraw just the initially required area.
Reported to eliminate black window contents after system Lock and similar actions.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/ScintillaWin.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 2ddc3944f..7bc05eec8 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -600,19 +600,16 @@ LRESULT ScintillaWin::WndPaint(uptr_t wParam) { } } else { #if defined(USE_D2D) - for (int attempt=0;attempt<2;attempt++) { - EnsureRenderTarget(); - AutoSurface surfaceWindow(pRenderTarget, this); - if (surfaceWindow) { - pRenderTarget->BeginDraw(); - Paint(surfaceWindow, rcPaint); - surfaceWindow->Release(); - HRESULT hr = pRenderTarget->EndDraw(); - if (hr == D2DERR_RECREATE_TARGET) { - DropRenderTarget(); - } else { - break; - } + EnsureRenderTarget(); + AutoSurface surfaceWindow(pRenderTarget, this); + if (surfaceWindow) { + pRenderTarget->BeginDraw(); + Paint(surfaceWindow, rcPaint); + surfaceWindow->Release(); + HRESULT hr = pRenderTarget->EndDraw(); + if (hr == D2DERR_RECREATE_TARGET) { + DropRenderTarget(); + paintState = paintAbandoned; } } #endif |