summaryrefslogtreecommitdiffstats
path: root/src/gui_w48.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-08-06 14:52:30 +0200
committerBram Moolenaar <Bram@vim.org>2014-08-06 14:52:30 +0200
commitb5a7a8b5451c6fe8a2cc1d5d86c42d9b9a50ef98 (patch)
treef5616b152c67bfa1de710ca93fe6f883c9069b46 /src/gui_w48.c
parent8c1329cb59e964797b8abdcf8d42af9877ea8daa (diff)
updated for version 7.4.393v7.4.393
Problem: Text drawing on newer MS-Windows systems is suboptimal. Some multi-byte characters are not displayed, even though the same font in Notepad can display them. (Srinath Avadhanula) Solution: Add the 'renderoptions' option to enable Direct-X drawing. (Taro Muraoka)
Diffstat (limited to 'src/gui_w48.c')
-rw-r--r--src/gui_w48.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 89b60908e5..ae4c921c0d 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2785,6 +2785,10 @@ _OnPaint(
out_flush(); /* make sure all output has been processed */
(void)BeginPaint(hwnd, &ps);
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX())
+ DWriteContext_BeginDraw(s_dwc);
+#endif
#ifdef FEAT_MBYTE
/* prevent multi-byte characters from misprinting on an invalid
@@ -2800,9 +2804,20 @@ _OnPaint(
#endif
if (!IsRectEmpty(&ps.rcPaint))
+ {
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX())
+ DWriteContext_BindDC(s_dwc, s_hdc, &ps.rcPaint);
+#endif
gui_redraw(ps.rcPaint.left, ps.rcPaint.top,
ps.rcPaint.right - ps.rcPaint.left + 1,
ps.rcPaint.bottom - ps.rcPaint.top + 1);
+ }
+
+#if defined(FEAT_DIRECTX)
+ if (IS_ENABLE_DIRECTX())
+ DWriteContext_EndDraw(s_dwc);
+#endif
EndPaint(hwnd, &ps);
}
}
@@ -3043,6 +3058,12 @@ gui_mch_insert_lines(
void
gui_mch_exit(int rc)
{
+#if defined(FEAT_DIRECTX)
+ DWriteContext_Close(s_dwc);
+ DWrite_Final();
+ s_dwc = NULL;
+#endif
+
ReleaseDC(s_textArea, s_hdc);
DeleteObject(s_brush);