[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115284: Fix bug #6364 with slow scrolling on MS-Win
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] trunk r115284: Fix bug #6364 with slow scrolling on MS-Windows with bitmap fonts. |
Date: |
Fri, 29 Nov 2013 11:02:39 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115284
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/6364
author: Tom Seddon <address@hidden>
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2013-11-29 13:01:45 +0200
message:
Fix bug #6364 with slow scrolling on MS-Windows with bitmap fonts.
src/w32font.c (g_b_init_get_char_width_32_w): New static var.
(globals_of_w32font): Zero it out.
(GetCharWidth32W_Proc): New function pointer.
(get_char_width_32_w): New function.
(compute_metrics): If get_glyph_outline_w returns an error, try
get_char_width_32_w before declaring a failure. This avoids
punishing raster (a.k.a. "bitmap") fonts by slowing down
redisplay.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/w32font.c w32font.c-20091113204419-o5vbwnq5f7feedwu-8545
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-11-29 08:53:50 +0000
+++ b/src/ChangeLog 2013-11-29 11:01:45 +0000
@@ -1,4 +1,13 @@
-2013-11-29 Eli Zaretskii <address@hidden>
+2013-11-29 Tom Seddon <address@hidden> (tiny change)
+
+ * w32font.c (g_b_init_get_char_width_32_w): New static var.
+ (globals_of_w32font): Zero it out.
+ (GetCharWidth32W_Proc): New function pointer.
+ (get_char_width_32_w): New function.
+ (compute_metrics): If get_glyph_outline_w returns an error, try
+ get_char_width_32_w before declaring a failure. This avoids
+ punishing raster (a.k.a. "bitmap") fonts by slowing down
+ redisplay. (Bug#6364).
* xdisp.c (clear_mouse_face): Don't invalidate the entire
mouse-highlight info, just signal frame_up_to_date_hook that mouse
=== modified file 'src/w32font.c'
--- a/src/w32font.c 2013-10-25 09:42:41 +0000
+++ b/src/w32font.c 2013-11-29 11:01:45 +0000
@@ -149,6 +149,7 @@
static BOOL g_b_init_get_text_metrics_w;
static BOOL g_b_init_get_glyph_outline_w;
static BOOL g_b_init_get_glyph_outline_w;
+static BOOL g_b_init_get_char_width_32_w;
typedef UINT (WINAPI * GetOutlineTextMetricsW_Proc) (
HDC hdc,
@@ -165,6 +166,11 @@
DWORD cbBuffer,
LPVOID lpvBuffer,
const MAT2 *lpmat2);
+typedef BOOL (WINAPI * GetCharWidth32W_Proc) (
+ HDC hdc,
+ UINT uFirstChar,
+ UINT uLastChar,
+ LPINT lpBuffer);
/* Several "wide" functions we use to support the font backends are
unavailable on Windows 9X, unless UNICOWS.DLL is installed (their
@@ -274,6 +280,23 @@
lpvBuffer, lpmat2);
}
+static DWORD WINAPI get_char_width_32_w (HDC hdc, UINT uFirstChar,
+ UINT uLastChar, LPINT lpBuffer)
+{
+ static GetCharWidth32W_Proc s_pfn_Get_Char_Width_32W = NULL;
+ HMODULE hm_unicows = NULL;
+ if (g_b_init_get_char_width_32_w == 0)
+ {
+ g_b_init_get_char_width_32_w = 1;
+ hm_unicows = w32_load_unicows_or_gdi32 ();
+ if (hm_unicows)
+ s_pfn_Get_Char_Width_32W = (GetCharWidth32W_Proc)
+ GetProcAddress (hm_unicows, "GetCharWidth32W");
+ }
+ eassert (s_pfn_Get_Char_Width_32W != NULL);
+ return s_pfn_Get_Char_Width_32W (hdc, uFirstChar, uLastChar, lpBuffer);
+}
+
static int
memq_no_quit (Lisp_Object elt, Lisp_Object list)
{
@@ -2437,6 +2460,7 @@
GLYPHMETRICS gm;
MAT2 transform;
unsigned int options = GGO_METRICS;
+ INT width;
if (w32_font->glyph_idx)
options |= GGO_GLYPH_INDEX;
@@ -2453,6 +2477,13 @@
metrics->width = gm.gmCellIncX;
metrics->status = W32METRIC_SUCCESS;
}
+ else if (get_char_width_32_w (dc, code, code, &width) != 0)
+ {
+ metrics->lbearing = 0;
+ metrics->rbearing = width;
+ metrics->width = width;
+ metrics->status = W32METRIC_SUCCESS;
+ }
else
metrics->status = W32METRIC_FAIL;
}
@@ -2727,4 +2758,5 @@
g_b_init_get_outline_metrics_w = 0;
g_b_init_get_text_metrics_w = 0;
g_b_init_get_glyph_outline_w = 0;
+ g_b_init_get_char_width_32_w = 0;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115284: Fix bug #6364 with slow scrolling on MS-Windows with bitmap fonts.,
Eli Zaretskii <=