Bug 1287552 - only set FC_PIXEL_SIZE in pattern if not already supplied. r=me
authorLee Salzman <lsalzman@mozilla.com>
Mon, 25 Jul 2016 15:00:06 -0400
changeset 346603 836321463a2642ed518990efb5cbef4f9cf5498d
parent 346602 387964e7a8eb8f5c5c10f214fa3ec33a2aa55cfa
child 346604 e29d0a6a50f0a5e9fcef4f1ba7cd0584512aaa4c
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1287552
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1287552 - only set FC_PIXEL_SIZE in pattern if not already supplied. r=me MozReview-Commit-ID: 9IVzZA4oohZ
gfx/skia/skia/src/ports/SkFontHost_cairo.cpp
--- a/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp
+++ b/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp
@@ -490,19 +490,21 @@ void SkScalerContext_CairoFT::parsePatte
     }
 }
 
 void SkScalerContext_CairoFT::resolvePattern(FcPattern* pattern)
 {
     if (!pattern) {
         return;
     }
-    SkAutoTUnref<FcPattern> scalePattern(FcPatternDuplicate(pattern));
-    if (scalePattern) {
-        if (FcPatternAddDouble(scalePattern, FC_PIXEL_SIZE, fScaleY) &&
+    FcValue value;
+    if (FcPatternGet(pattern, FC_PIXEL_SIZE, 0, &value) == FcResultNoMatch) {
+        SkAutoTUnref<FcPattern> scalePattern(FcPatternDuplicate(pattern));
+        if (scalePattern &&
+            FcPatternAddDouble(scalePattern, FC_PIXEL_SIZE, fScaleY) &&
             FcConfigSubstitute(nullptr, scalePattern, FcMatchPattern)) {
             FcDefaultSubstitute(scalePattern);
             FcResult result;
             SkAutoTUnref<FcPattern> resolved(FcFontMatch(nullptr, scalePattern, &result));
             if (resolved) {
                 parsePattern(resolved);
                 return;
             }