aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2021-06-25 19:47:51 +1000
committerZufu Liu <unknown>2021-06-25 19:47:51 +1000
commitb863e024b9bcdc78a11e2acbc93cc2e1ef79ba2e (patch)
tree3a02796960465ed764e308d25a4984612c482ba2
parentf1d157682479bfa08e82fb513b2d9510f736cc46 (diff)
downloadscintilla-mirror-b863e024b9bcdc78a11e2acbc93cc2e1ef79ba2e.tar.gz
Feature [feature-requests:#1400] Set buffering when technology set.
-rw-r--r--doc/ScintillaDoc.html12
-rw-r--r--doc/ScintillaHistory.html13
-rw-r--r--test/simpleTests.py26
-rw-r--r--win32/ScintillaWin.cxx1
4 files changed, 49 insertions, 3 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 9fbb50350..50409c0af 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -128,7 +128,7 @@
<h1>Scintilla Documentation</h1>
- <p>Last edited 17 June 2021 NH</p>
+ <p>Last edited 25 June 2021 NH</p>
<p style="background:#90F0C0">Scintilla 5 has moved the lexers from Scintilla into a new
<a href="Lexilla.html">Lexilla</a> project.<br />
@@ -4511,8 +4511,14 @@ struct Sci_TextToFind {
is retained after being presented which may prevent drawing failures on some cards and drivers.
<code>SC_TECHNOLOGY_DIRECTWRITEDC</code> differs from
<code>SC_TECHNOLOGY_DIRECTWRITE</code> by using DirectWrite to draw into a GDI DC.
- Since Direct2D buffers drawing, Scintilla's buffering can be turned off with
- <code>SCI_SETBUFFEREDDRAW(0)</code>.
+ </p>
+ <p>
+ On Win32, buffered drawing is set to a reasonable value for the technology: on for GDI and off for Direct2D
+ as Direct2D performs its own buffering.
+ This can be changed after setting technology with
+ <a class="seealso" href="#SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW</a>.
+ </p>
+ <p>
When using DirectWrite, you can use
<a class="message" href="#SCI_SETFONTLOCALE"><code>SCI_SETFONTLOCALE</code></a>
to set an appropriate font locale to draw text with expected language-dependent glyphs.
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 634a7ff50..542fd4eb9 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -565,6 +565,19 @@
</table>
<h2>Releases</h2>
<h3>
+ <a href="https://www.scintilla.org/scintilla511.zip">Release 5.1.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 23 June 2021.
+ </li>
+ <li>
+ On Win32, when technology is changed, buffering is set to a reasonable value for the technology:
+ on for GDI and off for Direct2D as Direct2D performs its own buffering.
+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1400/">Feature #1400</a>.
+ </li>
+ </ul>
+ <h3>
<a href="https://www.scintilla.org/scintilla510.zip">Release 5.1.0</a>
</h3>
<ul>
diff --git a/test/simpleTests.py b/test/simpleTests.py
index 2d8b25e68..dca1e24c4 100644
--- a/test/simpleTests.py
+++ b/test/simpleTests.py
@@ -1854,6 +1854,32 @@ class TestModalSelection(unittest.TestCase):
self.assertEquals(self.ed.GetSelectionNAnchor(0), 0)
self.ed.ClearSelections()
+class TestTechnology(unittest.TestCase):
+ """ These tests are just to ensure that the calls set and retrieve values.
+ They assume running on a Direct2D compatible version of Windows.
+ They do not check visual appearance.
+ """
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def tearDown(self):
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testTechnologyAndBufferedDraw(self):
+ self.ed.Technology = self.ed.SC_TECHNOLOGY_DEFAULT
+ self.assertEquals(self.ed.GetTechnology(), self.ed.SC_TECHNOLOGY_DEFAULT)
+ if sys.platform == "win32":
+ self.ed.Technology = self.ed.SC_TECHNOLOGY_DIRECTWRITE
+ self.assertEquals(self.ed.GetTechnology(), self.ed.SC_TECHNOLOGY_DIRECTWRITE)
+ self.assertEquals(self.ed.BufferedDraw, False)
+ self.ed.Technology = self.ed.SC_TECHNOLOGY_DEFAULT
+ self.assertEquals(self.ed.GetTechnology(), self.ed.SC_TECHNOLOGY_DEFAULT)
+ self.assertEquals(self.ed.BufferedDraw, True)
+
class TestStyleAttributes(unittest.TestCase):
""" These tests are just to ensure that the calls set and retrieve values.
They do not check the visual appearance of the style attributes.
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 0af4a6d65..64ca03cfa 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -1832,6 +1832,7 @@ sptr_t ScintillaWin::SciMessage(Message iMessage, uptr_t wParam, sptr_t lParam)
}
DropRenderTarget();
technology = technologyNew;
+ view.bufferedDraw = technologyNew == Technology::Default;
// Invalidate all cached information including layout.
DropGraphics();
InvalidateStyleRedraw();