Reland "Move remove ptr args to MakeRecAndEffects"

This is a reland of b07aba42145e29e0e995b373844c59846058a9ba

Original change's description:
> Move remove ptr args to MakeRecAndEffects
>
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
>
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
>
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I2ff7f218ecc7b18ae6a2b293cecdb059eea77562
Reviewed-on: https://skia-review.googlesource.com/c/170222
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/core/SkGlyphRun.cpp b/src/core/SkGlyphRun.cpp
index b595034..7043de8 100644
--- a/src/core/SkGlyphRun.cpp
+++ b/src/core/SkGlyphRun.cpp
@@ -368,7 +368,7 @@
     if (!glyphIDs.empty()) {
         fScratchAdvances.resize(runSize);
         {
-            auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(runPaint);
+            auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(runPaint);
             cache->getAdvances(glyphIDs, fScratchAdvances.data());
         }
 
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index e3900aa..1fb42cb 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -180,7 +180,7 @@
             SkScalar textScale = pathPaint.setupForAsPaths();
 
             auto pathCache = SkStrikeCache::FindOrCreateStrikeExclusive(
-                    pathPaint, &props, fScalerContextFlags, nullptr);
+                    pathPaint, props, fScalerContextFlags, SkMatrix::I());
 
             SkTDArray<PathAndPos> pathsAndPositions;
             pathsAndPositions.setReserve(runSize);
@@ -204,7 +204,7 @@
                     paint);
         } else {
             auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(
-                    paint, &props, fScalerContextFlags, &deviceMatrix);
+                    paint, props, fScalerContextFlags, deviceMatrix);
 
             // Add rounding and origin.
             SkMatrix matrix = deviceMatrix;
@@ -599,8 +599,8 @@
             fBlob->setHasBitmap();
             fBlob->setSubRunHasW(fRunIndex, glyphCacheMatrix.hasPerspective());
             SkExclusiveStrikePtr fallbackCache =
-                    fBlob->setupCache(fRunIndex, fProps, fScalerContextFlags,
-                                     fallbackPaint, &glyphCacheMatrix);
+                    fBlob->setupCache(fRunIndex,
+                                      fallbackPaint, fProps, fScalerContextFlags, glyphCacheMatrix);
             sk_sp<GrTextStrike> strike = fGlyphCache->getStrike(fallbackCache.get());
             const SkPoint* glyphPos = positions.data();
             for (auto glyphID : glyphIDs) {
@@ -649,7 +649,7 @@
 
             {
                 auto cache = this->setupCache(
-                        runIndex, props, flags, distanceFieldPaint, &SkMatrix::I());
+                        runIndex, distanceFieldPaint, props, flags, SkMatrix::I());
 
                 sk_sp<GrTextStrike> currStrike = glyphCache->getStrike(cache.get());
 
@@ -698,7 +698,7 @@
 
             SkScalar textScale = pathPaint.setupForAsPaths();
             auto pathCache = SkStrikeCache::FindOrCreateStrikeExclusive(
-                    pathPaint, &props, scalerContextFlags, &SkMatrix::I());
+                    pathPaint, props, scalerContextFlags, SkMatrix::I());
 
             // Given a glyph that is not ARGB, draw it.
             auto perPath = [textScale, runIndex, this, &pathCache]
@@ -723,7 +723,7 @@
             this->setHasBitmap();
 
             auto cache = this->setupCache(
-                    runIndex, props, scalerContextFlags, runPaint, &viewMatrix);
+                    runIndex, runPaint, props, scalerContextFlags, viewMatrix);
 
             sk_sp<GrTextStrike> currStrike = glyphCache->getStrike(cache.get());
 
diff --git a/src/core/SkOverdrawCanvas.cpp b/src/core/SkOverdrawCanvas.cpp
index 29d30b6..80c5e03 100644
--- a/src/core/SkOverdrawCanvas.cpp
+++ b/src/core/SkOverdrawCanvas.cpp
@@ -73,7 +73,7 @@
     SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
     this->getProps(&props);
     auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(
-            paint, &props, SkScalerContextFlags::kNone, &this->getTotalMatrix());
+            paint, props, SkScalerContextFlags::kNone, this->getTotalMatrix());
     SkFindAndPlaceGlyph::ProcessPosText(paint.getTextEncoding(), (const char*) text, byteLength,
                                         SkPoint::Make(0, 0), SkMatrix(), (const SkScalar*) pos, 2,
                                         cache.get(), processBounds);
diff --git a/src/core/SkPaint_text.cpp b/src/core/SkPaint_text.cpp
index 21a7c95..47f7891 100644
--- a/src/core/SkPaint_text.cpp
+++ b/src/core/SkPaint_text.cpp
@@ -102,7 +102,7 @@
         return SkToInt(byteLength >> 1);
     }
 
-    auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(*this);
+    auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(*this);
 
     const void* stop = (const char*)textData + byteLength;
     uint16_t*   gptr = glyphs;
@@ -137,7 +137,7 @@
         return true;
     }
 
-    auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(*this);
+    auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(*this);
     const void* stop = (const char*)textData + byteLength;
     const SkTypeface::Encoding encoding = to_encoding(this->getTextEncoding());
     while (textData < stop) {
@@ -158,7 +158,7 @@
 
     SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
     auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(
-            *this, &props, SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr);
+            *this, props, SkScalerContextFlags::kFakeGammaAndBoostContrast, SkMatrix::I());
 
     for (int index = 0; index < count; index++) {
         textData[index] = cache->glyphToUnichar(glyphs[index]);
@@ -390,7 +390,7 @@
     const SkPaint& paint = canon.getPaint();
     SkScalar scale = canon.getScale();
 
-    auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(paint);
+    auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(paint);
 
     SkScalar width = 0;
 
@@ -443,7 +443,7 @@
         maxWidth /= scale;
     }
 
-    auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(paint);
+    auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(paint);
 
     GlyphCacheProc   glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(),
                                                                  false);
@@ -486,7 +486,8 @@
     SkScalerContextEffects effects;
 
     auto desc = SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
-        paint, nullptr, SkScalerContextFlags::kNone, nullptr, &ad, &effects);
+        paint, SkSurfaceProps(0, kUnknown_SkPixelGeometry),
+        SkScalerContextFlags::kNone, SkMatrix::I(), &ad, &effects);
 
     {
         auto typeface = SkPaintPriv::GetTypefaceOrDefault(paint);
@@ -525,7 +526,7 @@
     const SkPaint& paint = canon.getPaint();
     SkScalar scale = canon.getScale();
 
-    auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(paint);
+    auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(paint);
     GlyphCacheProc      glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(),
                                                                     nullptr != bounds);
 
@@ -787,9 +788,7 @@
     }
 
     // SRGBTODO: Is this correct?
-    fCache = SkStrikeCache::FindOrCreateStrikeExclusive(
-        fPaint, nullptr,
-        SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr);
+    fCache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(fPaint);
 
     SkPaint::Style  style = SkPaint::kFill_Style;
     sk_sp<SkPathEffect> pe;
diff --git a/src/core/SkRemoteGlyphCache.cpp b/src/core/SkRemoteGlyphCache.cpp
index 976469f..c25d68d 100644
--- a/src/core/SkRemoteGlyphCache.cpp
+++ b/src/core/SkRemoteGlyphCache.cpp
@@ -64,7 +64,7 @@
     SkScalerContextRec deviceRec;
     bool enableTypefaceFiltering = (type == kDevice);
     SkScalerContext::MakeRecAndEffects(
-            font, paint, &props, &m, flags, &deviceRec, effects, enableTypefaceFiltering);
+            font, paint, props, flags, m, &deviceRec, effects, enableTypefaceFiltering);
     return SkScalerContext::AutoDescriptorGivenRecAndEffects(deviceRec, *effects, ad);
 }
 
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index f588bda..e667aef 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -900,15 +900,14 @@
 
 // The only reason this is not file static is because it needs the context of SkScalerContext to
 // access SkPaint::computeLuminanceColor.
-void SkScalerContext::MakeRecAndEffects(const SkFont& font,
-                                        const SkPaint& paint,
-                                        const SkSurfaceProps* surfaceProps,
-                                        const SkMatrix* deviceMatrix,
+void SkScalerContext::MakeRecAndEffects(const SkFont& font, const SkPaint& paint,
+                                        const SkSurfaceProps& surfaceProps,
                                         SkScalerContextFlags scalerContextFlags,
+                                        const SkMatrix& deviceMatrix,
                                         SkScalerContextRec* rec,
                                         SkScalerContextEffects* effects,
                                         bool enableTypefaceFiltering) {
-    SkASSERT(deviceMatrix == nullptr || !deviceMatrix->hasPerspective());
+    SkASSERT(!deviceMatrix.hasPerspective());
 
     sk_bzero(rec, sizeof(SkScalerContextRec));
 
@@ -921,24 +920,19 @@
 
     bool checkPost2x2 = false;
 
-    if (deviceMatrix) {
-        const SkMatrix::TypeMask mask = deviceMatrix->getType();
-        if (mask & SkMatrix::kScale_Mask) {
-            rec->fPost2x2[0][0] = sk_relax(deviceMatrix->getScaleX());
-            rec->fPost2x2[1][1] = sk_relax(deviceMatrix->getScaleY());
-            checkPost2x2 = true;
-        } else {
-            rec->fPost2x2[0][0] = rec->fPost2x2[1][1] = SK_Scalar1;
-        }
-        if (mask & SkMatrix::kAffine_Mask) {
-            rec->fPost2x2[0][1] = sk_relax(deviceMatrix->getSkewX());
-            rec->fPost2x2[1][0] = sk_relax(deviceMatrix->getSkewY());
-            checkPost2x2 = true;
-        } else {
-            rec->fPost2x2[0][1] = rec->fPost2x2[1][0] = 0;
-        }
+    const SkMatrix::TypeMask mask = deviceMatrix.getType();
+    if (mask & SkMatrix::kScale_Mask) {
+        rec->fPost2x2[0][0] = sk_relax(deviceMatrix.getScaleX());
+        rec->fPost2x2[1][1] = sk_relax(deviceMatrix.getScaleY());
+        checkPost2x2 = true;
     } else {
         rec->fPost2x2[0][0] = rec->fPost2x2[1][1] = SK_Scalar1;
+    }
+    if (mask & SkMatrix::kAffine_Mask) {
+        rec->fPost2x2[0][1] = sk_relax(deviceMatrix.getSkewX());
+        rec->fPost2x2[1][0] = sk_relax(deviceMatrix.getSkewY());
+        checkPost2x2 = true;
+    } else {
         rec->fPost2x2[0][1] = rec->fPost2x2[1][0] = 0;
     }
 
@@ -989,9 +983,8 @@
             rec->fMaskFormat = SkMask::kA8_Format;
             flags |= SkScalerContext::kGenA8FromLCD_Flag;
         } else {
-            SkPixelGeometry geometry = surfaceProps
-                                       ? surfaceProps->pixelGeometry()
-                                       : SkSurfacePropsDefaultPixelGeometry();
+            SkPixelGeometry geometry = surfaceProps.pixelGeometry();
+
             switch (geometry) {
                 case kUnknown_SkPixelGeometry:
                     // eeek, can't support LCD
@@ -1113,14 +1106,14 @@
 }
 
 SkDescriptor* SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
-    const SkPaint& paint, const SkSurfaceProps* surfaceProps,
+    const SkPaint& paint, const SkSurfaceProps& surfaceProps,
     SkScalerContextFlags scalerContextFlags,
-    const SkMatrix* deviceMatrix, SkAutoDescriptor* ad,
+    const SkMatrix& deviceMatrix, SkAutoDescriptor* ad,
     SkScalerContextEffects* effects) {
 
     SkFont font = SkFont::LEGACY_ExtractFromPaint(paint);
     SkScalerContextRec rec;
-    MakeRecAndEffects(font, paint, surfaceProps, deviceMatrix, scalerContextFlags, &rec, effects);
+    MakeRecAndEffects(font, paint, surfaceProps, scalerContextFlags, deviceMatrix, &rec, effects);
     return AutoDescriptorGivenRecAndEffects(rec, *effects, ad);
 }
 
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index e70ca51..0fa1df4 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -19,6 +19,7 @@
 #include "SkMaskGamma.h"
 #include "SkMatrix.h"
 #include "SkPaint.h"
+#include "SkSurfacePriv.h"
 #include "SkTypeface.h"
 #include "SkWriteBuffer.h"
 
@@ -311,25 +312,23 @@
     static bool   GetGammaLUTData(SkScalar contrast, SkScalar paintGamma, SkScalar deviceGamma,
                                   uint8_t* data);
 
-    static void MakeRecAndEffects(const SkFont& font,
-                                  const SkPaint& paint,
-                                  const SkSurfaceProps* surfaceProps,
-                                  const SkMatrix* deviceMatrix,
+    static void MakeRecAndEffects(const SkFont& font, const SkPaint& paint,
+                                  const SkSurfaceProps& surfaceProps,
                                   SkScalerContextFlags scalerContextFlags,
+                                  const SkMatrix& deviceMatrix,
                                   SkScalerContextRec* rec,
                                   SkScalerContextEffects* effects,
                                   bool enableTypefaceFiltering = true);
 
-    static void MakeRecAndEffectsUsingDefaultPaint(const SkFont& font,
-                                  const SkSurfaceProps* surfaceProps,
-                                  const SkMatrix* deviceMatrix,
-                                  SkScalerContextFlags scalerContextFlags,
-                                  SkScalerContextRec* rec,
-                                  SkScalerContextEffects* effects,
-                                  bool enableTypefaceFiltering = true) {
+    // If we are creating rec and effects from a font only, then there is no device around either.
+    static void MakeRecAndEffectsFromFont(const SkFont& font,
+                                          SkScalerContextRec* rec,
+                                          SkScalerContextEffects* effects,
+                                          bool enableTypefaceFiltering = true) {
         SkPaint paint;
-        return MakeRecAndEffects(font, paint, surfaceProps, deviceMatrix, scalerContextFlags,
-                                 rec, effects, enableTypefaceFiltering);
+        return MakeRecAndEffects(
+                font, paint, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType),
+                SkScalerContextFlags::kNone, SkMatrix::I(), rec, effects, enableTypefaceFiltering);
     }
 
     static SkDescriptor*  MakeDescriptorForPaths(SkFontID fontID,
@@ -364,9 +363,9 @@
     SkAxisAlignment computeAxisAlignmentForHText() const;
 
     static SkDescriptor* CreateDescriptorAndEffectsUsingPaint(
-        const SkPaint& paint, const SkSurfaceProps* surfaceProps,
+        const SkPaint& paint, const SkSurfaceProps& surfaceProps,
         SkScalerContextFlags scalerContextFlags,
-        const SkMatrix* deviceMatrix, SkAutoDescriptor* ad,
+        const SkMatrix& deviceMatrix, SkAutoDescriptor* ad,
         SkScalerContextEffects* effects);
 
 protected:
diff --git a/src/core/SkStrikeCache.cpp b/src/core/SkStrikeCache.cpp
index 0f3ca2d..477674f 100644
--- a/src/core/SkStrikeCache.cpp
+++ b/src/core/SkStrikeCache.cpp
@@ -148,9 +148,9 @@
 
 SkExclusiveStrikePtr SkStrikeCache::FindOrCreateStrikeExclusive(
         const SkPaint& paint,
-        const SkSurfaceProps* surfaceProps,
+        const SkSurfaceProps& surfaceProps,
         SkScalerContextFlags scalerContextFlags,
-        const SkMatrix* deviceMatrix)
+        const SkMatrix& deviceMatrix)
 {
     SkAutoDescriptor ad;
     SkScalerContextEffects effects;
@@ -163,9 +163,10 @@
     return FindOrCreateStrikeExclusive(*desc, effects, *tf);
 }
 
-SkExclusiveStrikePtr SkStrikeCache::FindOrCreateStrikeExclusive(const SkPaint& paint) {
+SkExclusiveStrikePtr SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(const SkPaint& paint) {
     return FindOrCreateStrikeExclusive(
-            paint, nullptr, kFakeGammaAndBoostContrast, nullptr);
+            paint, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType),
+            kFakeGammaAndBoostContrast, SkMatrix::I());
 }
 
 void SkStrikeCache::PurgeAll() {
diff --git a/src/core/SkStrikeCache.h b/src/core/SkStrikeCache.h
index 5d88126..5abaee4 100644
--- a/src/core/SkStrikeCache.h
+++ b/src/core/SkStrikeCache.h
@@ -104,11 +104,11 @@
 
     static ExclusiveStrikePtr FindOrCreateStrikeExclusive(
             const SkPaint& paint,
-            const SkSurfaceProps* surfaceProps,
+            const SkSurfaceProps& surfaceProps,
             SkScalerContextFlags scalerContextFlags,
-            const SkMatrix* deviceMatrix);
+            const SkMatrix& deviceMatrix);
 
-    static ExclusiveStrikePtr FindOrCreateStrikeExclusive(const SkPaint& paint);
+    static ExclusiveStrikePtr FindOrCreateStrikeWithNoDeviceExclusive(const SkPaint& paint);
 
     static std::unique_ptr<SkScalerContext> CreateScalerContext(
             const SkDescriptor&, const SkScalerContextEffects&, const SkTypeface&);
diff --git a/src/core/SkSurfacePriv.h b/src/core/SkSurfacePriv.h
index a41b583..e86a639 100644
--- a/src/core/SkSurfacePriv.h
+++ b/src/core/SkSurfacePriv.h
@@ -20,10 +20,6 @@
     }
 }
 
-static inline SkPixelGeometry SkSurfacePropsDefaultPixelGeometry() {
-    return SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType).pixelGeometry();
-}
-
 constexpr size_t kIgnoreRowBytesValue = static_cast<size_t>(~0);
 
 bool SkSurfaceValidateRasterInfo(const SkImageInfo&, size_t rb = kIgnoreRowBytesValue);
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 00fe495..96b61ce 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -14,6 +14,7 @@
 #include "SkOTTable_OS_2.h"
 #include "SkOnce.h"
 #include "SkStream.h"
+#include "SkSurfacePriv.h"
 #include "SkTypeface.h"
 #include "SkTypefaceCache.h"
 
@@ -401,10 +402,7 @@
     SkScalerContextRec rec;
     SkScalerContextEffects effects;
 
-    const SkSurfaceProps* defaultProps = nullptr;
-    const SkMatrix* noDeviceMatrix = nullptr;
-    SkScalerContext::MakeRecAndEffectsUsingDefaultPaint(
-        font, defaultProps, noDeviceMatrix, SkScalerContextFlags::kNone, &rec, &effects);
+    SkScalerContext::MakeRecAndEffectsFromFont(font, &rec, &effects);
 
     SkAutoDescriptor ad;
     SkScalerContextEffects noeffects;
diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp
index cc686f5..e035124 100644
--- a/src/gpu/text/GrTextBlob.cpp
+++ b/src/gpu/text/GrTextBlob.cpp
@@ -59,10 +59,10 @@
 }
 
 SkExclusiveStrikePtr GrTextBlob::setupCache(int runIndex,
-                                                 const SkSurfaceProps& props,
-                                                 SkScalerContextFlags scalerContextFlags,
-                                                 const SkPaint& skPaint,
-                                                 const SkMatrix* viewMatrix) {
+                                            const SkPaint& skPaint,
+                                            const SkSurfaceProps& props,
+                                            SkScalerContextFlags scalerContextFlags,
+                                            const SkMatrix& viewMatrix) {
     GrTextBlob::Run* run = &fRuns[runIndex];
 
     // if we have an override descriptor for the run, then we should use that
@@ -70,7 +70,7 @@
                                                               &run->fDescriptor;
     SkScalerContextEffects effects;
     SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
-        skPaint, &props, scalerContextFlags, viewMatrix, desc, &effects);
+        skPaint, props, scalerContextFlags, viewMatrix, desc, &effects);
     run->fTypeface = SkPaintPriv::RefTypefaceOrDefault(skPaint);
     run->fPathEffect = sk_ref_sp(effects.fPathEffect);
     run->fMaskFilter = sk_ref_sp(effects.fMaskFilter);
diff --git a/src/gpu/text/GrTextBlob.h b/src/gpu/text/GrTextBlob.h
index 1cccaca..f773d0b 100644
--- a/src/gpu/text/GrTextBlob.h
+++ b/src/gpu/text/GrTextBlob.h
@@ -180,10 +180,10 @@
     }
 
     SkExclusiveStrikePtr setupCache(int runIndex,
+                                    const SkPaint& skPaint,
                                     const SkSurfaceProps& props,
                                     SkScalerContextFlags scalerContextFlags,
-                                    const SkPaint& skPaint,
-                                    const SkMatrix* viewMatrix);
+                                    const SkMatrix& viewMatrix);
 
     // Appends a glyph to the blob.  If the glyph is too large, the glyph will be appended
     // as a path.
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 8f31408..da7afbf 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -46,7 +46,7 @@
     tmpPaint.setTextSize((SkScalar)unitsPerEm);
     const SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
     return SkStrikeCache::FindOrCreateStrikeExclusive(
-            tmpPaint, &props, SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr);
+            tmpPaint, props, SkScalerContextFlags::kFakeGammaAndBoostContrast, SkMatrix::I());
 }
 
 namespace {
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
index eecfe8c..b067c4f 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -1873,8 +1873,8 @@
     newTypefaceUse.xpsFont = xpsFontResource.release();
     auto glyphCache =
         SkStrikeCache::FindOrCreateStrikeExclusive(
-            paint, &this->surfaceProps(),
-            SkScalerContextFlags::kNone, nullptr);
+            paint, this->surfaceProps(),
+            SkScalerContextFlags::kNone, SkMatrix::I());
     unsigned int glyphCount = glyphCache->getGlyphCount();
     newTypefaceUse.glyphsUsed = new SkBitSet(glyphCount);
 
@@ -2057,8 +2057,8 @@
 
     auto cache =
         SkStrikeCache::FindOrCreateStrikeExclusive(
-            paint, &this->surfaceProps(),
-            SkScalerContextFlags::kNone, nullptr);
+            paint, this->surfaceProps(),
+            SkScalerContextFlags::kNone, SkMatrix::I());
 
     // Advance width and offsets for glyphs measured in hundredths of the font em size
     // (XPS Spec 5.1.3).