aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_FreeType.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-03-21 06:55:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-21 06:55:52 -0700
commitfe7ada7f0dc109cc8cf220607c2bd8c09bd1fa5e (patch)
tree53bec3fd08a6537b34bec413af86135545000669 /src/ports/SkFontHost_FreeType.cpp
parenta6359365887048ef055196de75591311d7a015f0 (diff)
Make FreeType usable on Windows.
Add missing functionality so that pdfium can use FreeType from Windows. Add an empty custom font manager so pdfium can use FreeType without any local fonts. R=bungeman@google.com Review URL: https://codereview.chromium.org/1817633002
Diffstat (limited to 'src/ports/SkFontHost_FreeType.cpp')
-rw-r--r--src/ports/SkFontHost_FreeType.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index f01c7d7cc5..e7cb6d2963 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -361,7 +361,8 @@ static FT_Face ref_ft_face(const SkTypeface* typeface) {
}
// Caller must lock gFTMutex before calling this function.
-static void unref_ft_face(FT_Face face) {
+extern void unref_ft_face(FT_Face face);
+void unref_ft_face(FT_Face face) {
gFTMutex.assertHeld();
SkFaceRec* rec = gFaceRecHead;
@@ -1284,7 +1285,6 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* metrics
SkAutoMutexAcquire ac(gFTMutex);
if (this->setupSize()) {
- ERROR:
sk_bzero(metrics, sizeof(*metrics));
return;
}
@@ -1376,7 +1376,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* metrics
metrics->fFlags &= ~SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag;
metrics->fFlags &= ~SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag;
} else {
- goto ERROR;
+ sk_bzero(metrics, sizeof(*metrics));
+ return;
}
// synthesize elements that were not provided by the os/2 table or format-specific metrics