aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMat Berchtold <unknown>2020-02-15 09:02:56 +1100
committerMat Berchtold <unknown>2020-02-15 09:02:56 +1100
commit127264a1b4984a2b23ff5c66ff5778630701a70c (patch)
treeab51b0c3feb1601c7e282e550bc8ce01cfad6db1 /src
parentb45dbedb37bcd591bf18d8891190acacbbc35bd7 (diff)
downloadscintilla-mirror-127264a1b4984a2b23ff5c66ff5778630701a70c.tar.gz
Backport: Bug [#2138]. Potential fix to Direct2D crash when updating driver.
Backport of changeset 7985:0ffb5afdbd7f.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index aec983f00..5da9f2b75 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1748,7 +1748,13 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
}
RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change
}
- PLATFORM_ASSERT(marginView.pixmapSelPattern->Initialised());
+
+ if (!marginView.pixmapSelPattern->Initialised()) {
+ // When Direct2D is used, pixmap creation may fail with D2DERR_RECREATE_TARGET so
+ // abandon this paint to avoid further failures.
+ // Main drawing surface and pixmaps should be recreated by next paint.
+ return;
+ }
if (!view.bufferedDraw)
surfaceWindow->SetClip(rcArea);