diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-07-06 18:07:27 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-09-26 11:04:25 +0800 |
commit | 6843d7fdd75382a162eefe0034d3e8e1d3b50293 (patch) | |
tree | 110db285d9391e32bdbffb33ec194803c08880ee /pango/pangowin32.c | |
parent | 0cebf7cf50c49ea30f00bdce724d290e43b8e29d (diff) | |
download | pango-6843d7fdd75382a162eefe0034d3e8e1d3b50293.tar.gz |
pangowin32: Initialize DirectWrite
We set up the boilerplate that is necessary for using DirectWrite in our code.
Also add code to tear it down after we are done with it.
Diffstat (limited to 'pango/pangowin32.c')
-rw-r--r-- | pango/pangowin32.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pango/pangowin32.c b/pango/pangowin32.c index eed92dde..55a079c9 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -126,11 +126,13 @@ _pango_win32_font_init (PangoWin32Font *win32font) } static GPrivate display_dc_key = G_PRIVATE_INIT ((GDestroyNotify) DeleteDC); +static GPrivate dwrite_items = G_PRIVATE_INIT ((GDestroyNotify) pango_win32_dwrite_items_destroy); HDC _pango_win32_get_display_dc (void) { HDC hdc = g_private_get (&display_dc_key); + PangoWin32DWriteItems *items; if (hdc == NULL) { @@ -151,9 +153,22 @@ _pango_win32_get_display_dc (void) #endif } + items = g_private_get (&dwrite_items); + if (items == NULL) + { + items = pango_win32_init_direct_write (); + g_private_set (&dwrite_items, items); + } + return hdc; } +PangoWin32DWriteItems * +pango_win32_get_direct_write_items (void) +{ + return g_private_get (&dwrite_items); +} + /** * pango_win32_get_dc: * |