aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-02-02 14:01:29 +1100
committerNeil <nyamatongwe@gmail.com>2022-02-02 14:01:29 +1100
commit53ca05457a1d7306defd98ee4a21eb18e6a9be8d (patch)
tree9f5d39af5c1604d8a84ef9f4c40e5af7a0215f64
parentb7345886dca4996d630a267f56fe2d7ce01fc88a (diff)
downloadscintilla-mirror-53ca05457a1d7306defd98ee4a21eb18e6a9be8d.tar.gz
Add Supports::ThreadSafeMeasureWidths for platforms to indicate if they support
concurrent calls to MeasureWidths.
-rw-r--r--cocoa/PlatCocoa.mm1
-rw-r--r--doc/ScintillaDoc.html17
-rwxr-xr-xgtk/PlatGTK.cxx4
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--include/ScintillaTypes.h1
-rw-r--r--win32/PlatWin.cxx1
7 files changed, 23 insertions, 3 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 239884341..bec420a66 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -348,6 +348,7 @@ const Supports SupportsCocoa[] = {
Supports::FractionalStrokeWidth,
Supports::TranslucentStroke,
Supports::PixelModification,
+ Supports::ThreadSafeMeasureWidths,
};
}
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index e54059624..58e8da944 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -50,6 +50,7 @@
table.standard tr:nth-child(even) {background: #F0F0F0}
table.standard td {
padding: 1px 5px 1px 5px;
+ vertical-align:top;
}
tr.section {
border-top:1px solid #808080;
@@ -128,7 +129,7 @@
<h1>Scintilla Documentation</h1>
- <p>Last edited 12 November 2021 NH</p>
+ <p>Last edited 2 February 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 />
@@ -4691,13 +4692,15 @@ struct Sci_TextToFind {
<tr>
<td><code>SC_SUPPORTS_LINE_DRAWS_FINAL</code></td>
<td>0</td>
- <td>Whether drawing a line draws its final position. Only false on Win32 GDI.</td>
+ <td>Whether drawing a line draws its final position.<br />
+ Only false on Win32 GDI.</div></td>
</tr>
<tr>
<td><code>SC_SUPPORTS_PIXEL_DIVISIONS</code></td>
<td>1</td>
- <td>Are logical pixels larger than physical pixels? Currently only true for macOS Cocoa with 'retina' displays.
+ <td>Are logical pixels larger than physical pixels?<br />
+ Currently only true for macOS Cocoa with 'retina' displays.<br />
When true, creating pixmaps at twice the resolution can produce clearer output with less blur.</td>
</tr>
@@ -4719,6 +4722,14 @@ struct Sci_TextToFind {
<td>Can individual pixels be modified? This is false for character cell platforms like curses.</td>
</tr>
+ <tr>
+ <td><code>SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS</code></td>
+ <td>5</td>
+ <td>Can text measurement be safely performed concurrently on multiple threads?<br />
+ Currently only true for macOS Cocoa, DirectWrite on Win32, and GTK on X or Wayland.
+ </td>
+ </tr>
+
</tbody>
</table>
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 53ee57300..859589bec 100755
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -215,6 +215,10 @@ const Supports SupportsGTK[] = {
Supports::FractionalStrokeWidth,
Supports::TranslucentStroke,
Supports::PixelModification,
+#if !defined(PLAT_GTK_WIN32) && !defined(PLAT_GTK_MACOSX)
+ // Pango is not thread-safe on Win32 or macOS
+ Supports::ThreadSafeMeasureWidths,
+#endif
};
}
diff --git a/include/Scintilla.h b/include/Scintilla.h
index b46e886b6..7ab0e3560 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -1101,6 +1101,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH 2
#define SC_SUPPORTS_TRANSLUCENT_STROKE 3
#define SC_SUPPORTS_PIXEL_MODIFICATION 4
+#define SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS 5
#define SCI_SUPPORTSFEATURE 2750
#define SC_LINECHARACTERINDEX_NONE 0
#define SC_LINECHARACTERINDEX_UTF32 1
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index f2ef2d33e..a98a310ab 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -3040,6 +3040,7 @@ val SC_SUPPORTS_PIXEL_DIVISIONS=1
val SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH=2
val SC_SUPPORTS_TRANSLUCENT_STROKE=3
val SC_SUPPORTS_PIXEL_MODIFICATION=4
+val SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS=5
# Get whether a feature is supported
get bool SupportsFeature=2750(Supports feature,)
diff --git a/include/ScintillaTypes.h b/include/ScintillaTypes.h
index 917878474..fe4b06032 100644
--- a/include/ScintillaTypes.h
+++ b/include/ScintillaTypes.h
@@ -507,6 +507,7 @@ enum class Supports {
FractionalStrokeWidth = 2,
TranslucentStroke = 3,
PixelModification = 4,
+ ThreadSafeMeasureWidths = 5,
};
enum class LineCharacterIndexType {
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 645decb35..9a41614cd 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -1282,6 +1282,7 @@ constexpr Supports SupportsD2D[] = {
Supports::FractionalStrokeWidth,
Supports::TranslucentStroke,
Supports::PixelModification,
+ Supports::ThreadSafeMeasureWidths,
};
constexpr D2D_COLOR_F ColorFromColourAlpha(ColourRGBA colour) noexcept {