aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-19 15:44:55 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-19 15:44:55 +1100
commit09534ab81f72ce766c8d13ea13216dd589d41a1c (patch)
tree2bb190bb18294936a55b1e2c6e70961f22268968 /src
parentdd9ae27be2d1b983638337f24685e6458360dfa3 (diff)
downloadscintilla-mirror-09534ab81f72ce766c8d13ea13216dd589d41a1c.tar.gz
Add an explicit FlushDrawing method to Surface that should be called after
completing a bitmap. Currently only has a real implementation on Direct2D. Avoiding implicit flushes inside Copy and FillRectangle produced a 23% speed improvement on files with about 1 indentation guide per line as the drawing pipeline was being flushed for each indentation guide.
Diffstat (limited to 'src')
-rw-r--r--src/EditView.cxx3
-rw-r--r--src/Editor.cxx1
-rw-r--r--src/MarginView.cxx2
-rw-r--r--src/Platform.h1
4 files changed, 7 insertions, 0 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 5d15abf12..8243169d0 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -324,6 +324,8 @@ void EditView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewSt
pixmapIndentGuide->FillRectangle(rcPixel, vsDraw.styles[STYLE_INDENTGUIDE].fore);
pixmapIndentGuideHighlight->FillRectangle(rcPixel, vsDraw.styles[STYLE_BRACELIGHT].fore);
}
+ pixmapIndentGuide->FlushDrawing();
+ pixmapIndentGuideHighlight->FlushDrawing();
}
}
@@ -2349,6 +2351,7 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, PRectan
const PRectangle rcCopyArea = PRectangle::FromInts(vsDraw.textStart - leftTextOverlap, yposScreen,
static_cast<int>(rcClient.right - vsDraw.rightMarginWidth),
yposScreen + vsDraw.lineHeight);
+ pixmapLine->FlushDrawing();
surfaceWindow->Copy(rcCopyArea, from, *pixmapLine);
}
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c0a0135e1..15936e150 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1713,6 +1713,7 @@ void Editor::PaintSelMargin(Surface *surfaceWindow, const PRectangle &rc) {
marginView.PaintMargin(surface, topLine, rc, rcMargin, *this, vs);
if (view.bufferedDraw) {
+ marginView.pixmapSelMargin->FlushDrawing();
surfaceWindow->Copy(rcMargin, Point(rcMargin.left, rcMargin.top), *marginView.pixmapSelMargin);
}
}
diff --git a/src/MarginView.cxx b/src/MarginView.cxx
index fbe3488c0..4d040776d 100644
--- a/src/MarginView.cxx
+++ b/src/MarginView.cxx
@@ -172,6 +172,8 @@ void MarginView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const View
pixmapSelPatternOffset1->FillRectangle(rcPixel, colourFMFill);
}
}
+ pixmapSelPattern->FlushDrawing();
+ pixmapSelPatternOffset1->FlushDrawing();
}
}
diff --git a/src/Platform.h b/src/Platform.h
index bdb6a161d..3333d3d4c 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -217,6 +217,7 @@ public:
virtual void SetClip(PRectangle rc)=0;
virtual void PopClip()=0;
virtual void FlushCachedState()=0;
+ virtual void FlushDrawing()=0;
virtual void SetUnicodeMode(bool unicodeMode_)=0;
virtual void SetDBCSMode(int codePage)=0;