diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-01-15 16:08:55 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-01-15 16:08:55 +0000 |
commit | 5a892583a5f09b7ade3aec7718fe401c80252bd2 (patch) | |
tree | 2384460563e667bb84ee9d6cdd13400e86aea6b7 /pango/pangowin32.c | |
parent | 58a38d6a4ba2152668a88316a3ddcef6842db072 (diff) | |
parent | c7d7c9eab24ef52596f43f0e698bb6e7cb7f027b (diff) | |
download | pango-5a892583a5f09b7ade3aec7718fe401c80252bd2.tar.gz |
Merge branch 'dwrite-cleanups' into 'main'
PangoWin32: Cleanup DirectWrite code a bit
See merge request GNOME/pango!667
Diffstat (limited to 'pango/pangowin32.c')
-rw-r--r-- | pango/pangowin32.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 5a26ee98..7b6325a5 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -133,7 +133,6 @@ HDC _pango_win32_get_display_dc (void) { HDC hdc = g_private_get (&display_dc_key); - PangoWin32DWriteItems *items; if (hdc == NULL) { @@ -154,12 +153,8 @@ _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); - } + /* ensure DirectWrite is initialized */ + pango_win32_get_direct_write_items (); return hdc; } @@ -167,7 +162,15 @@ _pango_win32_get_display_dc (void) PangoWin32DWriteItems * pango_win32_get_direct_write_items (void) { - return g_private_get (&dwrite_items); + PangoWin32DWriteItems *items = g_private_get (&dwrite_items); + + if (items == NULL) + { + items = pango_win32_init_direct_write (); + g_private_set (&dwrite_items, items); + } + + return items; } /** |