Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: src/utils/win/SkDWrite.cpp

Issue 217733002: Support user-configurable function to create IDWriteFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/ports/SkTypeface_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/win/SkDWrite.cpp
diff --git a/src/utils/win/SkDWrite.cpp b/src/utils/win/SkDWrite.cpp
index 16e8ddc4d0d93c4103283616199df0ed5df9aa18..156b36f91376f54fffc107eb483bae682474c2a2 100644
--- a/src/utils/win/SkDWrite.cpp
+++ b/src/utils/win/SkDWrite.cpp
@@ -13,8 +13,18 @@
#include <dwrite.h>
static IDWriteFactory* gDWriteFactory = NULL;
+static void (*gDWriteFactoryProc)(IDWriteFactory**) = NULL;
+
+void SkSetDirectWriteFactoryProc(void (*proc)(IDWriteFactory**)) {
+ gDWriteFactoryProc = proc;
+}
static void create_dwrite_factory(IDWriteFactory** factory) {
+ if (gDWriteFactoryProc) {
+ gDWriteFactoryProc(factory);
+ return;
+ }
+
typedef decltype(DWriteCreateFactory)* DWriteCreateFactoryProc;
DWriteCreateFactoryProc dWriteCreateFactoryProc = reinterpret_cast<DWriteCreateFactoryProc>(
GetProcAddress(LoadLibraryW(L"dwrite.dll"), "DWriteCreateFactory"));
« no previous file with comments | « include/ports/SkTypeface_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698