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

Unified Diff: src/ports/SkScalerContext_win_dw.cpp

Issue 537633002: Allow for Skia to be built without dwrite 1.1 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: And those should be ifndef not ifdef... Created 6 years, 3 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 | « no previous file | src/ports/SkTypeface_win_dw.h » ('j') | src/ports/SkTypeface_win_dw.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkScalerContext_win_dw.cpp
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index 33ef0d55ec29a3ee7b2efbc911cc98c5441faf6d..ddf3f4ad683967f275aedbe95bb76e34dd06f601 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -26,7 +26,9 @@
#include "SkTypeface_win_dw.h"
#include <dwrite.h>
+#ifndef SK_IGNORE_DWRITE_1_SUPPORT
#include <dwrite_1.h>
+#endif
static bool isLCD(const SkScalerContext::Rec& rec) {
return SkMask::kLCD16_Format == rec.fMaskFormat ||
@@ -524,6 +526,7 @@ void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* metrics) {
metrics->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag;
metrics->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag;
+#ifndef SK_IGNORE_DWRITE_1_SUPPORT
if (NULL != fTypeface->fDWriteFontFace1.get()) {
DWRITE_FONT_METRICS1 dwfm1;
fTypeface->fDWriteFontFace1->GetMetrics(&dwfm1);
@@ -533,7 +536,9 @@ void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* metrics) {
metrics->fXMax = fTextSizeRender * SkIntToScalar(dwfm1.glyphBoxRight) / upem;
metrics->fMaxCharWidth = metrics->fXMax - metrics->fXMin;
- } else {
+ } else
+#endif
+ {
AutoTDWriteTable<SkOTTableHead> head(fTypeface->fDWriteFontFace.get());
if (head.fExists &&
head.fSize >= sizeof(SkOTTableHead) &&
« no previous file with comments | « no previous file | src/ports/SkTypeface_win_dw.h » ('j') | src/ports/SkTypeface_win_dw.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698