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 | f0ff36d2c8880120da098a9d58bd7c9077233a82 (patch) | |
| tree | b233f8670440ee7a7c37760b266bffdccebeb107 | |
| parent | c6a3241048c9dd55a61eea2227b77161892f87d6 (diff) | |
| download | scintilla-mirror-f0ff36d2c8880120da098a9d58bd7c9077233a82.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.
| -rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 23 |
2 files changed, 14 insertions, 13 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index fb750e384..b2cc9c40f 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -483,6 +483,10 @@ <a href="http://sourceforge.net/p/scintilla/feature-requests/887/">Feature #887.</a> </li> <li> + Fix another problem with drawing on Windows with Direct2D when returning from lock screen. + The whole window is redrawn as just redrawing the initially required area left other areas black. + </li> + <li> When scroll width is tracked, take width of annotation lines into account. </li> <li> 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 |
