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

Unified Diff: src/ports/SkTypeface_win_dw.h

Issue 2065833002: Support pixel antialising in DirectWrite. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use the same grid fit mode no matter the rotation. Created 4 years, 5 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 | « src/ports/SkScalerContext_win_dw.cpp ('k') | src/ports/SkTypeface_win_dw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkTypeface_win_dw.h
diff --git a/src/ports/SkTypeface_win_dw.h b/src/ports/SkTypeface_win_dw.h
index 1119841e00285f55e657bae1659b98e7d61541e9..3c896b5c4aea0d659a4c78ff4fb943ca6c93dbbf 100644
--- a/src/ports/SkTypeface_win_dw.h
+++ b/src/ports/SkTypeface_win_dw.h
@@ -20,6 +20,9 @@
#if SK_HAS_DWRITE_1_H
# include <dwrite_1.h>
#endif
+#if SK_HAS_DWRITE_2_H
+# include <dwrite_2.h>
+#endif
class SkFontDescriptor;
struct SkScalerContextRec;
@@ -61,10 +64,23 @@ private:
SkASSERT_RELEASE(nullptr == fDWriteFontFace1.get());
}
#endif
+#if SK_HAS_DWRITE_2_H
+ if (!SUCCEEDED(fDWriteFontFace->QueryInterface(&fDWriteFontFace2))) {
+ SkASSERT_RELEASE(nullptr == fDWriteFontFace2.get());
+ }
+ if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) {
+ SkASSERT_RELEASE(nullptr == fFactory2.get());
+ }
+#endif
}
public:
SkTScopedComPtr<IDWriteFactory> fFactory;
+#if SK_HAS_DWRITE_2_H
+ SkTScopedComPtr<IDWriteFactory2> fFactory2;
+#else
+ const decltype(nullptr) fFactory2 = nullptr;
+#endif
SkTScopedComPtr<IDWriteFontCollectionLoader> fDWriteFontCollectionLoader;
SkTScopedComPtr<IDWriteFontFileLoader> fDWriteFontFileLoader;
SkTScopedComPtr<IDWriteFontFamily> fDWriteFontFamily;
@@ -73,6 +89,11 @@ public:
#if SK_HAS_DWRITE_1_H
SkTScopedComPtr<IDWriteFontFace1> fDWriteFontFace1;
#endif
+#if SK_HAS_DWRITE_2_H
+ SkTScopedComPtr<IDWriteFontFace2> fDWriteFontFace2;
+#else
+ const decltype(nullptr) fDWriteFontFace2 = nullptr;
+#endif
static DWriteFontTypeface* Create(IDWriteFactory* factory,
IDWriteFontFace* fontFace,
« no previous file with comments | « src/ports/SkScalerContext_win_dw.cpp ('k') | src/ports/SkTypeface_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698