Bug 1722454 - Remove USE_SKIA. r=gfx-reviewers,jrmuizel
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 29 Jul 2021 23:29:44 +0000
changeset 587116 f3935d46328e92b16bc1d4de9a5de00921e22a02
parent 587115 b4e30230e7bbc199c84d9fa6f1bf983286c657f8
child 587117 23c4d23b71c267a821c05f1ca36809fed893081c
push id147152
push usermh@glandium.org
push dateThu, 29 Jul 2021 23:32:21 +0000
treeherderautoland@f3935d46328e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfx-reviewers, jrmuizel
bugs1722454
milestone92.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 1722454 - Remove USE_SKIA. r=gfx-reviewers,jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D120935
gfx/2d/2D.h
gfx/2d/BorrowedContext.h
gfx/2d/DrawTargetCairo.cpp
gfx/2d/Factory.cpp
gfx/2d/Scale.cpp
gfx/2d/ScaledFontBase.cpp
gfx/2d/ScaledFontBase.h
gfx/2d/ScaledFontDWrite.cpp
gfx/2d/ScaledFontDWrite.h
gfx/2d/ScaledFontFontconfig.cpp
gfx/2d/ScaledFontFontconfig.h
gfx/2d/ScaledFontFreeType.cpp
gfx/2d/ScaledFontFreeType.h
gfx/2d/ScaledFontMac.cpp
gfx/2d/ScaledFontMac.h
gfx/2d/ScaledFontWin.cpp
gfx/2d/ScaledFontWin.h
toolkit/moz.configure
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -1770,18 +1770,17 @@ class GFX2D_API Factory {
   static already_AddRefed<SourceSurface> CreateSourceSurfaceForCairoSurface(
       cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat aFormat);
 
   static already_AddRefed<DrawTarget> CreateDrawTarget(BackendType aBackend,
                                                        const IntSize& aSize,
                                                        SurfaceFormat aFormat);
 
   /**
-   * Create a simple PathBuilder, which uses SKIA backend. If USE_SKIA is not
-   * defined, this returns nullptr;
+   * Create a simple PathBuilder, which uses SKIA backend.
    */
   static already_AddRefed<PathBuilder> CreateSimplePathBuilder();
 
   /**
    * Create a DrawTarget that captures the drawing commands to eventually be
    * replayed onto the DrawTarget provided. An optional byte size can be
    * provided as a limit for the CaptureCommandList. When the limit is reached,
    * the CaptureCommandList will be replayed to the target and then cleared.
@@ -1934,20 +1933,18 @@ class GFX2D_API Factory {
 
   static void SetBGRSubpixelOrder(bool aBGR);
   static bool GetBGRSubpixelOrder();
 
  private:
   static bool mBGRSubpixelOrder;
 
  public:
-#ifdef USE_SKIA
   static already_AddRefed<DrawTarget> CreateDrawTargetWithSkCanvas(
       SkCanvas* aCanvas);
-#endif
 
 #ifdef MOZ_ENABLE_FREETYPE
   static void SetFTLibrary(FT_Library aFTLibrary);
   static FT_Library GetFTLibrary();
 
   static FT_Library NewFTLibrary();
   static void ReleaseFTLibrary(FT_Library aFTLibrary);
   static void LockFTLibrary(FT_Library aFTLibrary);
--- a/gfx/2d/BorrowedContext.h
+++ b/gfx/2d/BorrowedContext.h
@@ -168,28 +168,18 @@ class BorrowedCGContext {
     }
   }
 
   ~BorrowedCGContext() { MOZ_ASSERT(!cg); }
 
   CGContextRef cg;
 
  private:
-#  ifdef USE_SKIA
   static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget* aDT);
   static void ReturnCGContextToDrawTarget(DrawTarget* aDT, CGContextRef cg);
-#  else
-  static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget* aDT) {
-    MOZ_CRASH("Not supported without Skia");
-  }
-
-  static void ReturnCGContextToDrawTarget(DrawTarget* aDT, CGContextRef cg) {
-    MOZ_CRASH("not supported without Skia");
-  }
-#  endif
   DrawTarget* mDT;
 };
 #endif
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif  // _MOZILLA_GFX_BORROWED_CONTEXT_H
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -1923,133 +1923,24 @@ already_AddRefed<DrawTarget> DrawTargetC
 
   RefPtr<DrawTargetCairo> target = new DrawTargetCairo();
   if (target->InitAlreadyReferenced(tee, aSize)) {
     return target.forget();
   }
   return nullptr;
 }
 
-#ifndef USE_SKIA
-static inline pixman_format_code_t GfxFormatToPixmanFormat(
-    SurfaceFormat aFormat) {
-  switch (aFormat) {
-    case SurfaceFormat::A8R8G8B8_UINT32:
-      return PIXMAN_a8r8g8b8;
-    case SurfaceFormat::X8R8G8B8_UINT32:
-      return PIXMAN_x8r8g8b8;
-    case SurfaceFormat::R5G6B5_UINT16:
-      return PIXMAN_r5g6b5;
-    case SurfaceFormat::A8:
-      return PIXMAN_a8;
-    default:
-      // Allow both BGRA and ARGB formats to be passed through unmodified,
-      // even though even though we are actually rendering to A8R8G8B8_UINT32.
-      if (aFormat == SurfaceFormat::B8G8R8A8 ||
-          aFormat == SurfaceFormat::A8R8G8B8) {
-        return PIXMAN_a8r8g8b8;
-      }
-      return (pixman_format_code_t)0;
-  }
-}
-#endif
-
 static inline bool GfxMatrixToPixmanTransform(const Matrix4x4& aMatrix,
                                               pixman_transform* aResult) {
   pixman_f_transform fTransform = {{{aMatrix._11, aMatrix._21, aMatrix._41},
                                     {aMatrix._12, aMatrix._22, aMatrix._42},
                                     {aMatrix._14, aMatrix._24, aMatrix._44}}};
   return pixman_transform_from_pixman_f_transform(aResult, &fTransform);
 }
 
-#ifndef USE_SKIA
-bool DrawTarget::Draw3DTransformedSurface(SourceSurface* aSurface,
-                                          const Matrix4x4& aMatrix) {
-  // Composite the 3D transform with the DT's transform.
-  Matrix4x4 fullMat = aMatrix * Matrix4x4::From2D(mTransform);
-  // Transform the surface bounds and clip to this DT.
-  IntRect xformBounds = RoundedOut(fullMat.TransformAndClipBounds(
-      Rect(Point(0, 0), Size(aSurface->GetSize())),
-      Rect(Point(0, 0), Size(GetSize()))));
-  if (xformBounds.IsEmpty()) {
-    return true;
-  }
-  // Offset the matrix by the transformed origin.
-  fullMat.PostTranslate(-xformBounds.x, -xformBounds.y, 0);
-  // Invert the matrix into a pattern matrix for pixman.
-  if (!fullMat.Invert()) {
-    return false;
-  }
-  pixman_transform xform;
-  if (!GfxMatrixToPixmanTransform(fullMat, &xform)) {
-    return false;
-  }
-
-  // Read in the source data.
-  RefPtr<DataSourceSurface> srcSurf = aSurface->GetDataSurface();
-  pixman_format_code_t srcFormat =
-      GfxFormatToPixmanFormat(srcSurf->GetFormat());
-  if (!srcFormat) {
-    return false;
-  }
-  DataSourceSurface::ScopedMap srcMap(srcSurf, DataSourceSurface::READ);
-  if (!srcMap.IsMapped()) {
-    return false;
-  }
-
-  // Set up an intermediate destination surface only the size of the transformed
-  // bounds. Try to pass through the source's format unmodified in both the BGRA
-  // and ARGB cases.
-  RefPtr<DataSourceSurface> dstSurf = Factory::CreateDataSourceSurface(
-      xformBounds.Size(), srcFormat == PIXMAN_a8r8g8b8
-                              ? srcSurf->GetFormat()
-                              : SurfaceFormat::A8R8G8B8_UINT32);
-  if (!dstSurf) {
-    return false;
-  }
-
-  // Wrap the surfaces in pixman images and do the transform.
-  pixman_image_t* dst = pixman_image_create_bits(
-      PIXMAN_a8r8g8b8, xformBounds.width, xformBounds.height,
-      (uint32_t*)dstSurf->GetData(), dstSurf->Stride());
-  if (!dst) {
-    return false;
-  }
-  pixman_image_t* src = pixman_image_create_bits(
-      srcFormat, srcSurf->GetSize().width, srcSurf->GetSize().height,
-      (uint32_t*)srcMap.GetData(), srcMap.GetStride());
-  if (!src) {
-    pixman_image_unref(dst);
-    return false;
-  }
-
-  pixman_image_set_filter(src, PIXMAN_FILTER_BILINEAR, nullptr, 0);
-  pixman_image_set_transform(src, &xform);
-
-  pixman_image_composite32(PIXMAN_OP_SRC, src, nullptr, dst, 0, 0, 0, 0, 0, 0,
-                           xformBounds.width, xformBounds.height);
-
-  pixman_image_unref(dst);
-  pixman_image_unref(src);
-
-  // Temporarily reset the DT's transform, since it has already been composed
-  // above.
-  Matrix origTransform = mTransform;
-  SetTransform(Matrix());
-
-  // Draw the transformed surface within the transformed bounds.
-  DrawSurface(dstSurf, Rect(xformBounds),
-              Rect(Point(0, 0), Size(xformBounds.Size())));
-
-  SetTransform(origTransform);
-
-  return true;
-}
-#endif
-
 #ifdef CAIRO_HAS_XLIB_SURFACE
 static bool gXRenderInitialized = false;
 static bool gXRenderHasTransform = false;
 
 static bool SupportsXRender(cairo_surface_t* surface) {
   if (!surface || cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_XLIB ||
       !cairo_xlib_surface_get_xrender_format(surface)) {
     return false;
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -7,20 +7,18 @@
 #include "2D.h"
 #include "Swizzle.h"
 
 #ifdef USE_CAIRO
 #  include "DrawTargetCairo.h"
 #  include "SourceSurfaceCairo.h"
 #endif
 
-#ifdef USE_SKIA
-#  include "DrawTargetSkia.h"
-#  include "ScaledFontBase.h"
-#endif
+#include "DrawTargetSkia.h"
+#include "ScaledFontBase.h"
 
 #if defined(WIN32)
 #  include "ScaledFontWin.h"
 #  include "NativeFontResourceGDI.h"
 #  include "UnscaledFontGDI.h"
 #endif
 
 #ifdef XP_DARWIN
@@ -374,26 +372,24 @@ already_AddRefed<DrawTarget> Factory::Cr
       RefPtr<DrawTargetD2D1> newTarget;
       newTarget = new DrawTargetD2D1();
       if (newTarget->Init(aSize, aFormat)) {
         retVal = newTarget;
       }
       break;
     }
 #endif
-#ifdef USE_SKIA
     case BackendType::SKIA: {
       RefPtr<DrawTargetSkia> newTarget;
       newTarget = new DrawTargetSkia();
       if (newTarget->Init(aSize, aFormat)) {
         retVal = newTarget;
       }
       break;
     }
-#endif
 #ifdef USE_CAIRO
     case BackendType::CAIRO: {
       RefPtr<DrawTargetCairo> newTarget;
       newTarget = new DrawTargetCairo();
       if (newTarget->Init(aSize, aFormat)) {
         retVal = newTarget;
       }
       break;
@@ -413,24 +409,17 @@ already_AddRefed<DrawTarget> Factory::Cr
         << "Failed to create DrawTarget, Type: " << int(aBackend)
         << " Size: " << aSize;
   }
 
   return retVal.forget();
 }
 
 already_AddRefed<PathBuilder> Factory::CreateSimplePathBuilder() {
-  RefPtr<PathBuilder> pathBuilder;
-#ifdef USE_SKIA
-  pathBuilder = MakeAndAddRef<PathBuilderSkia>(FillRule::FILL_WINDING);
-#endif
-  if (!pathBuilder) {
-    NS_WARNING("Failed to create a path builder because we don't use Skia");
-  }
-  return pathBuilder.forget();
+  return MakeAndAddRef<PathBuilderSkia>(FillRule::FILL_WINDING);
 }
 
 already_AddRefed<DrawTarget> Factory::CreateRecordingDrawTarget(
     DrawEventRecorder* aRecorder, DrawTarget* aDT, IntRect aRect) {
   return MakeAndAddRef<DrawTargetRecording>(aRecorder, aDT, aRect);
 }
 
 already_AddRefed<DrawTargetCapture> Factory::CreateCaptureDrawTargetForTarget(
@@ -467,26 +456,24 @@ already_AddRefed<DrawTarget> Factory::Cr
     gfxCriticalError(LoggerOptionsBasedOnSize(aSize))
         << "Failed to allocate a surface due to invalid size (DTD) " << aSize;
     return nullptr;
   }
 
   RefPtr<DrawTarget> retVal;
 
   switch (aBackend) {
-#ifdef USE_SKIA
     case BackendType::SKIA: {
       RefPtr<DrawTargetSkia> newTarget;
       newTarget = new DrawTargetSkia();
       if (newTarget->Init(aData, aSize, aStride, aFormat, aUninitialized)) {
         retVal = newTarget;
       }
       break;
     }
-#endif
 #ifdef USE_CAIRO
     case BackendType::CAIRO: {
       RefPtr<DrawTargetCairo> newTarget;
       newTarget = new DrawTargetCairo();
       if (newTarget->Init(aData, aSize, aStride, aFormat)) {
         retVal = std::move(newTarget);
       }
       break;
@@ -550,20 +537,18 @@ bool Factory::DoesBackendSupportDataDraw
 
   return false;
 }
 
 uint32_t Factory::GetMaxSurfaceSize(BackendType aType) {
   switch (aType) {
     case BackendType::CAIRO:
       return DrawTargetCairo::GetMaxSurfaceSize();
-#ifdef USE_SKIA
     case BackendType::SKIA:
       return DrawTargetSkia::GetMaxSurfaceSize();
-#endif
 #ifdef WIN32
     case BackendType::DIRECT2D1_1:
       return DrawTargetD2D1::GetMaxSurfaceSize();
 #endif
     default:
       return 0;
   }
 }
@@ -1035,26 +1020,24 @@ already_AddRefed<ScaledFont> Factory::Cr
 already_AddRefed<ScaledFont> Factory::CreateScaledFontForGDIFont(
     const void* aLogFont, const RefPtr<UnscaledFont>& aUnscaledFont,
     Float aSize) {
   return MakeAndAddRef<ScaledFontWin>(static_cast<const LOGFONT*>(aLogFont),
                                       aUnscaledFont, aSize);
 }
 #endif  // WIN32
 
-#ifdef USE_SKIA
 already_AddRefed<DrawTarget> Factory::CreateDrawTargetWithSkCanvas(
     SkCanvas* aCanvas) {
   RefPtr<DrawTargetSkia> newTarget = new DrawTargetSkia();
   if (!newTarget->Init(aCanvas)) {
     return nullptr;
   }
   return newTarget.forget();
 }
-#endif
 
 void Factory::PurgeAllCaches() {}
 
 already_AddRefed<DrawTarget> Factory::CreateDrawTargetForCairoSurface(
     cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat) {
   if (!AllowedSurfaceSize(aSize)) {
     gfxWarning() << "Allowing surface with invalid size (Cairo) " << aSize;
   }
--- a/gfx/2d/Scale.cpp
+++ b/gfx/2d/Scale.cpp
@@ -1,28 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Scale.h"
 
-#ifdef USE_SKIA
-#  include "HelpersSkia.h"
-#  include "skia/src/core/SkBitmapScaler.h"
-#endif
+#include "HelpersSkia.h"
+#include "skia/src/core/SkBitmapScaler.h"
 
 namespace mozilla {
 namespace gfx {
 
 bool Scale(uint8_t* srcData, int32_t srcWidth, int32_t srcHeight,
            int32_t srcStride, uint8_t* dstData, int32_t dstWidth,
            int32_t dstHeight, int32_t dstStride, SurfaceFormat format) {
-#ifdef USE_SKIA
   SkPixmap srcPixmap(MakeSkiaImageInfo(IntSize(srcWidth, srcHeight), format),
                      srcData, srcStride);
 
   // Rescaler is compatible with N32 only. Convert to N32 if needed.
   SkBitmap tmpBitmap;
   if (srcPixmap.colorType() != kN32_SkColorType) {
     if (!tmpBitmap.tryAllocPixels(
             SkImageInfo::MakeN32Premul(srcWidth, srcHeight)) ||
@@ -31,15 +28,12 @@ bool Scale(uint8_t* srcData, int32_t src
       return false;
     }
   }
 
   SkPixmap dstPixmap(SkImageInfo::MakeN32Premul(dstWidth, dstHeight), dstData,
                      dstStride);
   return SkBitmapScaler::Resize(dstPixmap, srcPixmap,
                                 SkBitmapScaler::RESIZE_LANCZOS3);
-#else
-  return false;
-#endif
 }
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/2d/ScaledFontBase.cpp
+++ b/gfx/2d/ScaledFontBase.cpp
@@ -1,20 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ScaledFontBase.h"
 
-#ifdef USE_SKIA
-#  include "PathSkia.h"
-#  include "skia/include/core/SkFont.h"
-#endif
+#include "PathSkia.h"
+#include "skia/include/core/SkFont.h"
 
 #ifdef USE_CAIRO
 #  include "PathCairo.h"
 #  include "DrawTargetCairo.h"
 #  include "HelpersCairo.h"
 #endif
 
 #include <vector>
@@ -27,52 +25,37 @@ Atomic<uint32_t> UnscaledFont::sDeletion
 
 UnscaledFont::~UnscaledFont() { sDeletionCounter++; }
 
 Atomic<uint32_t> ScaledFont::sDeletionCounter(0);
 
 ScaledFont::~ScaledFont() { sDeletionCounter++; }
 
 ScaledFontBase::~ScaledFontBase() {
-#ifdef USE_SKIA
   SkSafeUnref<SkTypeface>(mTypeface);
-#endif
-#ifdef USE_CAIRO_SCALED_FONT
   cairo_scaled_font_destroy(mScaledFont);
-#endif
 }
 
 ScaledFontBase::ScaledFontBase(const RefPtr<UnscaledFont>& aUnscaledFont,
                                Float aSize)
-    : ScaledFont(aUnscaledFont)
-#ifdef USE_SKIA
-      ,
-      mTypeface(nullptr)
-#endif
-#ifdef USE_CAIRO_SCALED_FONT
-      ,
-      mScaledFont(nullptr)
-#endif
-      ,
-      mSize(aSize) {
-}
+    : ScaledFont(aUnscaledFont),
+      mTypeface(nullptr),
+      mScaledFont(nullptr),
+      mSize(aSize) {}
 
-#ifdef USE_SKIA
 SkTypeface* ScaledFontBase::GetSkTypeface() {
   if (!mTypeface) {
     SkTypeface* typeface = CreateSkTypeface();
     if (!mTypeface.compareExchange(nullptr, typeface)) {
       SkSafeUnref(typeface);
     }
   }
   return mTypeface;
 }
-#endif
 
-#ifdef USE_CAIRO_SCALED_FONT
 cairo_scaled_font_t* ScaledFontBase::GetCairoScaledFont() {
   if (mScaledFont) {
     return mScaledFont;
   }
 
   cairo_font_options_t* fontOptions = cairo_font_options_create();
   cairo_font_face_t* fontFace = CreateCairoFontFace(fontOptions);
   if (!fontFace) {
@@ -96,19 +79,17 @@ cairo_scaled_font_t* ScaledFontBase::Get
     cairo_scaled_font_destroy(scaledFont);
     return nullptr;
   }
 
   PrepareCairoScaledFont(scaledFont);
   mScaledFont = scaledFont;
   return mScaledFont;
 }
-#endif
 
-#ifdef USE_SKIA
 SkPath ScaledFontBase::GetSkiaPathForGlyphs(const GlyphBuffer& aBuffer) {
   SkTypeface* typeFace = GetSkTypeface();
   MOZ_ASSERT(typeFace);
 
   SkFont font(sk_ref_sp(typeFace), SkFloatToScalar(mSize));
 
   std::vector<uint16_t> indices;
   indices.resize(aBuffer.mNumGlyphs);
@@ -132,26 +113,23 @@ SkPath ScaledFontBase::GetSkiaPathForGly
           ctx.mPath.addPath(*glyphPath, transMatrix);
         }
         ++ctx.mGlyph;
       },
       &ctx);
 
   return ctx.mPath;
 }
-#endif
 
 already_AddRefed<Path> ScaledFontBase::GetPathForGlyphs(
     const GlyphBuffer& aBuffer, const DrawTarget* aTarget) {
-#ifdef USE_SKIA
   if (aTarget->GetBackendType() == BackendType::SKIA) {
     SkPath path = GetSkiaPathForGlyphs(aBuffer);
     return MakeAndAddRef<PathSkia>(path, FillRule::FILL_WINDING);
   }
-#endif
 #ifdef USE_CAIRO
   if (aTarget->GetBackendType() == BackendType::CAIRO) {
     MOZ_ASSERT(mScaledFont);
 
     DrawTarget* dt = const_cast<DrawTarget*>(aTarget);
     cairo_t* ctx = static_cast<cairo_t*>(
         dt->GetNativeSurface(NativeSurfaceType::CAIRO_CONTEXT));
 
@@ -180,37 +158,32 @@ already_AddRefed<Path> ScaledFontBase::G
     RefPtr<PathCairo> newPath = new PathCairo(ctx);
     if (isNewContext) {
       cairo_destroy(ctx);
     }
 
     return newPath.forget();
   }
 #endif
-#ifdef USE_SKIA
   RefPtr<PathBuilder> builder = aTarget->CreatePathBuilder();
   SkPath skPath = GetSkiaPathForGlyphs(aBuffer);
   RefPtr<Path> path = MakeAndAddRef<PathSkia>(skPath, FillRule::FILL_WINDING);
   path->StreamToSink(builder);
   return builder->Finish();
-#endif
-  return nullptr;
 }
 
 void ScaledFontBase::CopyGlyphsToBuilder(const GlyphBuffer& aBuffer,
                                          PathBuilder* aBuilder,
                                          const Matrix* aTransformHint) {
   BackendType backendType = aBuilder->GetBackendType();
-#ifdef USE_SKIA
   if (backendType == BackendType::SKIA) {
     PathBuilderSkia* builder = static_cast<PathBuilderSkia*>(aBuilder);
     builder->AppendPath(GetSkiaPathForGlyphs(aBuffer));
     return;
   }
-#endif
 #ifdef USE_CAIRO
   if (backendType == BackendType::CAIRO) {
     MOZ_ASSERT(mScaledFont);
 
     PathBuilderCairo* builder = static_cast<PathBuilderCairo*>(aBuilder);
     cairo_t* ctx = cairo_create(DrawTargetCairo::GetDummySurface());
 
     if (aTransformHint) {
@@ -232,21 +205,19 @@ void ScaledFontBase::CopyGlyphsToBuilder
 
     RefPtr<PathCairo> cairoPath = new PathCairo(ctx);
     cairo_destroy(ctx);
 
     cairoPath->AppendPathToBuilder(builder);
     return;
   }
 #endif
-#ifdef USE_SKIA
   if (backendType == BackendType::RECORDING) {
     SkPath skPath = GetSkiaPathForGlyphs(aBuffer);
     RefPtr<Path> path = MakeAndAddRef<PathSkia>(skPath, FillRule::FILL_WINDING);
     path->StreamToSink(aBuilder);
     return;
   }
-#endif
   MOZ_ASSERT(false, "Path not being copied");
 }
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/2d/ScaledFontBase.h
+++ b/gfx/2d/ScaledFontBase.h
@@ -4,29 +4,21 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_GFX_SCALEDFONTBASE_H_
 #define MOZILLA_GFX_SCALEDFONTBASE_H_
 
 #include "2D.h"
 
+#include "skia/include/core/SkFont.h"
+#include "skia/include/core/SkPath.h"
+#include "skia/include/core/SkTypeface.h"
 // Skia uses cairo_scaled_font_t as the internal font type in ScaledFont
-#if defined(USE_SKIA) || defined(USE_CAIRO)
-#  define USE_CAIRO_SCALED_FONT
-#endif
-
-#ifdef USE_SKIA
-#  include "skia/include/core/SkFont.h"
-#  include "skia/include/core/SkPath.h"
-#  include "skia/include/core/SkTypeface.h"
-#endif
-#ifdef USE_CAIRO_SCALED_FONT
-#  include "cairo.h"
-#endif
+#include "cairo.h"
 
 namespace mozilla {
 namespace gfx {
 
 class ScaledFontBase : public ScaledFont {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontBase, override)
 
@@ -37,39 +29,31 @@ class ScaledFontBase : public ScaledFont
       const GlyphBuffer& aBuffer, const DrawTarget* aTarget) override;
 
   virtual void CopyGlyphsToBuilder(const GlyphBuffer& aBuffer,
                                    PathBuilder* aBuilder,
                                    const Matrix* aTransformHint) override;
 
   virtual Float GetSize() const override { return mSize; }
 
-#ifdef USE_SKIA
   SkTypeface* GetSkTypeface();
   virtual void SetupSkFontDrawOptions(SkFont& aFont) {}
-#endif
 
-#ifdef USE_CAIRO_SCALED_FONT
   virtual cairo_scaled_font_t* GetCairoScaledFont() override;
-#endif
 
  protected:
   friend class DrawTargetSkia;
-#ifdef USE_SKIA
   Atomic<SkTypeface*> mTypeface;
   virtual SkTypeface* CreateSkTypeface() { return nullptr; }
   SkPath GetSkiaPathForGlyphs(const GlyphBuffer& aBuffer);
-#endif
-#ifdef USE_CAIRO_SCALED_FONT
   virtual cairo_font_face_t* CreateCairoFontFace(
       cairo_font_options_t* aFontOptions) {
     return nullptr;
   }
   virtual void PrepareCairoScaledFont(cairo_scaled_font_t* aFont) {}
   cairo_scaled_font_t* mScaledFont;
-#endif
   Float mSize;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_SCALEDFONTBASE_H_ */
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -23,28 +23,24 @@
 // not be present.
 // To work around this, until the build environment is updated,
 // we #include an extra header that contains copies of the relevant
 // classes/interfaces we need.
 #if !defined(__MINGW32__) && WINVER < 0x0A00
 #  include "dw-extra.h"
 #endif
 
-#ifdef USE_SKIA
-#  include "PathSkia.h"
-#  include "skia/include/core/SkPaint.h"
-#  include "skia/include/core/SkPath.h"
-#  include "skia/include/ports/SkTypeface_win.h"
-#endif
+#include "PathSkia.h"
+#include "skia/include/core/SkPaint.h"
+#include "skia/include/core/SkPath.h"
+#include "skia/include/ports/SkTypeface_win.h"
 
 #include <vector>
 
-#ifdef USE_CAIRO_SCALED_FONT
-#  include "cairo-win32.h"
-#endif
+#include "cairo-win32.h"
 
 #include "HelpersWinFonts.h"
 
 namespace mozilla {
 namespace gfx {
 
 #define GASP_TAG 0x70736167
 #define GASP_DOGRAY 0x2
@@ -157,17 +153,16 @@ already_AddRefed<Path> ScaledFontDWrite:
   PathBuilderD2D* pathBuilderD2D =
       static_cast<PathBuilderD2D*>(pathBuilder.get());
 
   CopyGlyphsToSink(aBuffer, pathBuilderD2D->GetSink());
 
   return pathBuilder->Finish();
 }
 
-#ifdef USE_SKIA
 SkTypeface* ScaledFontDWrite::CreateSkTypeface() {
   RefPtr<IDWriteFactory> factory = Factory::GetDWriteFactory();
   if (!factory) {
     return nullptr;
   }
 
   Float gamma = mGamma;
   // Skia doesn't support a gamma value outside of 0-4, so default to 2.2
@@ -195,17 +190,16 @@ void ScaledFontDWrite::SetupSkFontDrawOp
   if (ForceGDIMode()) {
     aFont.setEmbeddedBitmaps(true);
     aFont.setSubpixel(false);
   } else {
     aFont.setEmbeddedBitmaps(UseEmbeddedBitmaps());
     aFont.setSubpixel(true);
   }
 }
-#endif
 
 void ScaledFontDWrite::CopyGlyphsToBuilder(const GlyphBuffer& aBuffer,
                                            PathBuilder* aBuilder,
                                            const Matrix* aTransformHint) {
   BackendType backendType = aBuilder->GetBackendType();
   if (backendType == BackendType::CAPTURE) {
     StreamingGeometrySink sink(aBuilder);
     CopyGlyphsToSink(aBuffer, &sink);
@@ -695,32 +689,30 @@ AntialiasMode ScaledFontDWrite::GetDefau
       break;
     case AntialiasMode::NONE:
       break;
   }
 
   return defaultMode;
 }
 
-#ifdef USE_CAIRO_SCALED_FONT
 cairo_font_face_t* ScaledFontDWrite::CreateCairoFontFace(
     cairo_font_options_t* aFontOptions) {
   if (!mFontFace) {
     return nullptr;
   }
 
   return cairo_dwrite_font_face_create_for_dwrite_fontface(nullptr, mFontFace);
 }
 
 void ScaledFontDWrite::PrepareCairoScaledFont(cairo_scaled_font_t* aFont) {
   if (mRenderingMode == DWRITE_RENDERING_MODE_GDI_CLASSIC) {
     cairo_dwrite_scaled_font_set_force_GDI_classic(aFont, true);
   }
 }
-#endif
 
 already_AddRefed<UnscaledFont> UnscaledFontDWrite::CreateFromFontDescriptor(
     const uint8_t* aData, uint32_t aDataLength, uint32_t aIndex) {
   if (aDataLength == 0) {
     gfxWarning() << "DWrite font descriptor is truncated.";
     return nullptr;
   }
 
--- a/gfx/2d/ScaledFontDWrite.h
+++ b/gfx/2d/ScaledFontDWrite.h
@@ -66,41 +66,37 @@ class ScaledFontDWrite final : public Sc
     return mRenderingMode == DWRITE_RENDERING_MODE_GDI_CLASSIC;
   }
   DWRITE_RENDERING_MODE GetRenderingMode() const { return mRenderingMode; }
 
   bool HasSyntheticBold() const {
     return (mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD) != 0;
   }
 
-#ifdef USE_SKIA
   SkTypeface* CreateSkTypeface() override;
   void SetupSkFontDrawOptions(SkFont& aFont) override;
   SkFontStyle mStyle;
-#endif
 
   RefPtr<IDWriteFontFace> mFontFace;
   bool mUseEmbeddedBitmap;
   DWRITE_RENDERING_MODE mRenderingMode;
   // DrawTargetD2D1 requires the IDWriteRenderingParams,
   // but we also separately need to store the gamma and contrast
   // since Skia needs to be able to access these without having
   // to use the full set of DWrite parameters (which would be
   // required to recreate an IDWriteRenderingParams) in a
   // DrawTargetRecording playback.
   RefPtr<IDWriteRenderingParams> mParams;
   Float mGamma;
   Float mContrast;
   Float mClearTypeLevel;
 
-#ifdef USE_CAIRO_SCALED_FONT
   cairo_font_face_t* CreateCairoFontFace(
       cairo_font_options_t* aFontOptions) override;
   void PrepareCairoScaledFont(cairo_scaled_font_t* aFont) override;
-#endif
 
  private:
   friend class NativeFontResourceDWrite;
   friend class UnscaledFontDWrite;
 
   struct InstanceData {
     explicit InstanceData(ScaledFontDWrite* aScaledFont)
         : mUseEmbeddedBitmap(aScaledFont->mUseEmbeddedBitmap),
--- a/gfx/2d/ScaledFontFontconfig.cpp
+++ b/gfx/2d/ScaledFontFontconfig.cpp
@@ -6,20 +6,18 @@
 
 #include "ScaledFontFontconfig.h"
 #include "UnscaledFontFreeType.h"
 #include "NativeFontResourceFreeType.h"
 #include "Logging.h"
 #include "mozilla/StaticPrefs_gfx.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 
-#ifdef USE_SKIA
-#  include "skia/include/ports/SkTypeface_cairo.h"
-#  include "HelpersSkia.h"
-#endif
+#include "skia/include/ports/SkTypeface_cairo.h"
+#include "HelpersSkia.h"
 
 #include <fontconfig/fcfreetype.h>
 
 #include FT_LCD_FILTER_H
 #include FT_MULTIPLE_MASTERS_H
 
 namespace mozilla::gfx {
 
@@ -45,17 +43,16 @@ bool ScaledFontFontconfig::UseSubpixelPo
          FT_IS_SCALABLE(mFace->GetFace()) &&
          (mInstanceData.mHinting == FontHinting::NONE ||
           mInstanceData.mHinting == FontHinting::LIGHT ||
           MOZ_UNLIKELY(
               StaticPrefs::
                   gfx_text_subpixel_position_force_enabled_AtStartup()));
 }
 
-#ifdef USE_SKIA
 SkTypeface* ScaledFontFontconfig::CreateSkTypeface() {
   SkPixelGeometry geo = mInstanceData.mFlags & InstanceData::SUBPIXEL_BGR
                             ? (mInstanceData.mFlags & InstanceData::LCD_VERTICAL
                                    ? kBGR_V_SkPixelGeometry
                                    : kBGR_H_SkPixelGeometry)
                             : (mInstanceData.mFlags & InstanceData::LCD_VERTICAL
                                    ? kRGB_V_SkPixelGeometry
                                    : kRGB_H_SkPixelGeometry);
@@ -73,29 +70,26 @@ void ScaledFontFontconfig::SetupSkFontDr
     aFont.setEmbeddedBitmaps(true);
   }
   if (mInstanceData.mFlags & InstanceData::EMBOLDEN) {
     aFont.setEmbolden(true);
   }
 
   aFont.setHinting(GfxHintingToSkiaHinting(mInstanceData.mHinting));
 }
-#endif
 
-#ifdef USE_CAIRO_SCALED_FONT
 cairo_font_face_t* ScaledFontFontconfig::CreateCairoFontFace(
     cairo_font_options_t* aFontOptions) {
   int loadFlags;
   unsigned int synthFlags;
   mInstanceData.SetupFontOptions(aFontOptions, &loadFlags, &synthFlags);
 
   return cairo_ft_font_face_create_for_ft_face(mFace->GetFace(), loadFlags,
                                                synthFlags, mFace.get());
 }
-#endif
 
 AntialiasMode ScaledFontFontconfig::GetDefaultAAMode() {
   return mInstanceData.mAntialias;
 }
 
 ScaledFontFontconfig::InstanceData::InstanceData(FcPattern* aPattern)
     : mFlags(0),
       mAntialias(AntialiasMode::NONE),
--- a/gfx/2d/ScaledFontFontconfig.h
+++ b/gfx/2d/ScaledFontFontconfig.h
@@ -20,20 +20,18 @@ class UnscaledFontFontconfig;
 class ScaledFontFontconfig : public ScaledFontBase {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontFontconfig, override)
   ScaledFontFontconfig(RefPtr<SharedFTFace>&& aFace, FcPattern* aPattern,
                        const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize);
 
   FontType GetType() const override { return FontType::FONTCONFIG; }
 
-#ifdef USE_SKIA
   SkTypeface* CreateSkTypeface() override;
   void SetupSkFontDrawOptions(SkFont& aFont) override;
-#endif
 
   AntialiasMode GetDefaultAAMode() override;
 
   bool UseSubpixelPosition() const;
 
   bool CanSerialize() override { return true; }
 
   bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override;
@@ -41,20 +39,18 @@ class ScaledFontFontconfig : public Scal
   bool GetWRFontInstanceOptions(
       Maybe<wr::FontInstanceOptions>* aOutOptions,
       Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
       std::vector<FontVariation>* aOutVariations) override;
 
   bool HasVariationSettings() override;
 
  protected:
-#ifdef USE_CAIRO_SCALED_FONT
   cairo_font_face_t* CreateCairoFontFace(
       cairo_font_options_t* aFontOptions) override;
-#endif
 
  private:
   friend class NativeFontResourceFontconfig;
   friend class UnscaledFontFontconfig;
 
   struct InstanceData {
     enum {
       AUTOHINT = 1 << 0,
--- a/gfx/2d/ScaledFontFreeType.cpp
+++ b/gfx/2d/ScaledFontFreeType.cpp
@@ -6,19 +6,17 @@
 
 #include "ScaledFontFreeType.h"
 #include "UnscaledFontFreeType.h"
 #include "NativeFontResourceFreeType.h"
 #include "Logging.h"
 #include "mozilla/StaticPrefs_gfx.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 
-#ifdef USE_SKIA
-#  include "skia/include/ports/SkTypeface_cairo.h"
-#endif
+#include "skia/include/ports/SkTypeface_cairo.h"
 
 #include FT_MULTIPLE_MASTERS_H
 
 namespace mozilla {
 namespace gfx {
 
 ScaledFontFreeType::ScaledFontFreeType(
     RefPtr<SharedFTFace>&& aFace, const RefPtr<UnscaledFont>& aUnscaledFont,
@@ -29,33 +27,30 @@ ScaledFontFreeType::ScaledFontFreeType(
 
 bool ScaledFontFreeType::UseSubpixelPosition() const {
   return !MOZ_UNLIKELY(
              StaticPrefs::
                  gfx_text_subpixel_position_force_disabled_AtStartup()) &&
          FT_IS_SCALABLE(mFace->GetFace());
 }
 
-#ifdef USE_SKIA
 SkTypeface* ScaledFontFreeType::CreateSkTypeface() {
   return SkCreateTypefaceFromCairoFTFont(mFace->GetFace(), mFace.get());
 }
 
 void ScaledFontFreeType::SetupSkFontDrawOptions(SkFont& aFont) {
   aFont.setSubpixel(UseSubpixelPosition());
 
   if (mApplySyntheticBold) {
     aFont.setEmbolden(true);
   }
 
   aFont.setEmbeddedBitmaps(true);
 }
-#endif
 
-#ifdef USE_CAIRO_SCALED_FONT
 cairo_font_face_t* ScaledFontFreeType::CreateCairoFontFace(
     cairo_font_options_t* aFontOptions) {
   cairo_font_options_set_hint_metrics(aFontOptions, CAIRO_HINT_METRICS_OFF);
 
   int loadFlags = FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING;
   if (mFace->GetFace()->face_flags & FT_FACE_FLAG_TRICKY) {
     loadFlags &= ~FT_LOAD_NO_AUTOHINT;
   }
@@ -63,17 +58,16 @@ cairo_font_face_t* ScaledFontFreeType::C
   unsigned int synthFlags = 0;
   if (mApplySyntheticBold) {
     synthFlags |= CAIRO_FT_SYNTHESIZE_BOLD;
   }
 
   return cairo_ft_font_face_create_for_ft_face(mFace->GetFace(), loadFlags,
                                                synthFlags, mFace.get());
 }
-#endif
 
 bool ScaledFontFreeType::GetFontInstanceData(FontInstanceDataOutput aCb,
                                              void* aBaton) {
   std::vector<FontVariation> variations;
   if (HasVariationSettings()) {
     UnscaledFontFreeType::GetVariationSettingsFromFace(&variations,
                                                        mFace->GetFace());
   }
--- a/gfx/2d/ScaledFontFreeType.h
+++ b/gfx/2d/ScaledFontFreeType.h
@@ -21,20 +21,18 @@ class ScaledFontFreeType : public Scaled
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontFreeType, override)
 
   ScaledFontFreeType(RefPtr<SharedFTFace>&& aFace,
                      const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
                      bool aApplySyntheticBold = false);
 
   FontType GetType() const override { return FontType::FREETYPE; }
 
-#ifdef USE_SKIA
   SkTypeface* CreateSkTypeface() override;
   void SetupSkFontDrawOptions(SkFont& aFont) override;
-#endif
 
   AntialiasMode GetDefaultAAMode() override { return AntialiasMode::GRAY; }
 
   bool UseSubpixelPosition() const;
 
   bool CanSerialize() override { return true; }
 
   bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override;
@@ -42,20 +40,18 @@ class ScaledFontFreeType : public Scaled
   bool GetWRFontInstanceOptions(
       Maybe<wr::FontInstanceOptions>* aOutOptions,
       Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
       std::vector<FontVariation>* aOutVariations) override;
 
   bool HasVariationSettings() override;
 
  protected:
-#ifdef USE_CAIRO_SCALED_FONT
   cairo_font_face_t* CreateCairoFontFace(
       cairo_font_options_t* aFontOptions) override;
-#endif
 
  private:
   friend UnscaledFontFreeType;
 
   RefPtr<SharedFTFace> mFace;
 
   bool mApplySyntheticBold;
 
--- a/gfx/2d/ScaledFontMac.cpp
+++ b/gfx/2d/ScaledFontMac.cpp
@@ -2,22 +2,20 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ScaledFontMac.h"
 #include "UnscaledFontMac.h"
 #include "mozilla/webrender/WebRenderTypes.h"
-#ifdef USE_SKIA
-#  include "PathSkia.h"
-#  include "skia/include/core/SkPaint.h"
-#  include "skia/include/core/SkPath.h"
-#  include "skia/include/ports/SkTypeface_mac.h"
-#endif
+#include "PathSkia.h"
+#include "skia/include/core/SkPaint.h"
+#include "skia/include/core/SkPath.h"
+#include "skia/include/ports/SkTypeface_mac.h"
 #include <vector>
 #include <dlfcn.h>
 #ifdef MOZ_WIDGET_UIKIT
 #  include <CoreFoundation/CoreFoundation.h>
 #endif
 #include "nsCocoaFeatures.h"
 #include "mozilla/gfx/Logging.h"
 
@@ -25,19 +23,17 @@
 // prototype for private API
 extern "C" {
 CGPathRef CGFontGetGlyphPath(CGFontRef fontRef,
                              CGAffineTransform* textTransform, int unknown,
                              CGGlyph glyph);
 };
 #endif
 
-#ifdef USE_CAIRO_SCALED_FONT
-#  include "cairo-quartz.h"
-#endif
+#include "cairo-quartz.h"
 
 namespace mozilla {
 namespace gfx {
 
 // Simple helper class to automatically release a CFObject when it goes out
 // of scope.
 template <class T>
 class AutoRelease final {
@@ -159,17 +155,16 @@ ScaledFontMac::ScaledFontMac(CTFontRef a
   CFRetain(mCTFont);
 }
 
 ScaledFontMac::~ScaledFontMac() {
   CFRelease(mCTFont);
   CGFontRelease(mFont);
 }
 
-#ifdef USE_SKIA
 SkTypeface* ScaledFontMac::CreateSkTypeface() {
   return SkCreateTypefaceFromCTFont(mCTFont);
 }
 
 void ScaledFontMac::SetupSkFontDrawOptions(SkFont& aFont) {
   aFont.setSubpixel(true);
 
   // Normally, Skia enables LCD FontSmoothing which creates thicker fonts
@@ -186,17 +181,16 @@ void ScaledFontMac::SetupSkFontDrawOptio
   // we want to have grayscale AA with no smoothing at all. This means
   // disabling the LCD font smoothing behaviour.
   // To accomplish this we have to explicitly disable hinting,
   // and disable LCDRenderText.
   if (aFont.getEdging() == SkFont::Edging::kAntiAlias && !mUseFontSmoothing) {
     aFont.setHinting(SkFontHinting::kNone);
   }
 }
-#endif
 
 // private API here are the public options on OS X
 // CTFontCreatePathForGlyph
 // ATSUGlyphGetCubicPaths
 // we've used this in cairo sucessfully for some time.
 // Note: cairo dlsyms it. We could do that but maybe it's
 // safe just to use?
 
@@ -732,23 +726,21 @@ already_AddRefed<ScaledFont> UnscaledFon
     Float aGlyphSize, const wr::FontInstanceOptions* aOptions,
     const wr::FontInstancePlatformOptions* aPlatformOptions,
     const FontVariation* aVariations, uint32_t aNumVariations) {
   ScaledFontMac::InstanceData instanceData(aOptions, aPlatformOptions);
   return CreateScaledFont(aGlyphSize, reinterpret_cast<uint8_t*>(&instanceData),
                           sizeof(instanceData), aVariations, aNumVariations);
 }
 
-#ifdef USE_CAIRO_SCALED_FONT
 cairo_font_face_t* ScaledFontMac::CreateCairoFontFace(
     cairo_font_options_t* aFontOptions) {
   MOZ_ASSERT(mFont);
   return cairo_quartz_font_face_create_for_cgfont(mFont);
 }
-#endif
 
 already_AddRefed<UnscaledFont> UnscaledFontMac::CreateFromFontDescriptor(
     const uint8_t* aData, uint32_t aDataLength, uint32_t aIndex) {
   if (aDataLength == 0) {
     gfxWarning() << "Mac font descriptor is truncated.";
     return nullptr;
   }
   CFStringRef name =
--- a/gfx/2d/ScaledFontMac.h
+++ b/gfx/2d/ScaledFontMac.h
@@ -33,40 +33,36 @@ class ScaledFontMac : public ScaledFontB
       bool aUseFontSmoothing = true, bool aApplySyntheticBold = false);
   ScaledFontMac(
       CTFontRef aFont, const RefPtr<UnscaledFont>& aUnscaledFont,
       const DeviceColor& aFontSmoothingBackgroundColor = DeviceColor(),
       bool aUseFontSmoothing = true, bool aApplySyntheticBold = false);
   ~ScaledFontMac();
 
   FontType GetType() const override { return FontType::MAC; }
-#ifdef USE_SKIA
   SkTypeface* CreateSkTypeface() override;
   void SetupSkFontDrawOptions(SkFont& aFont) override;
-#endif
   already_AddRefed<Path> GetPathForGlyphs(const GlyphBuffer& aBuffer,
                                           const DrawTarget* aTarget) override;
 
   bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override;
 
   bool GetWRFontInstanceOptions(
       Maybe<wr::FontInstanceOptions>* aOutOptions,
       Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
       std::vector<FontVariation>* aOutVariations) override;
 
   bool CanSerialize() override { return true; }
 
   DeviceColor FontSmoothingBackgroundColor() {
     return mFontSmoothingBackgroundColor;
   }
 
-#ifdef USE_CAIRO_SCALED_FONT
   cairo_font_face_t* CreateCairoFontFace(
       cairo_font_options_t* aFontOptions) override;
-#endif
 
  private:
   friend class DrawTargetSkia;
   friend class UnscaledFontMac;
 
   CGFontRef mFont;
   CTFontRef
       mCTFont;  // only created if CTFontDrawGlyphs is available, otherwise null
--- a/gfx/2d/ScaledFontWin.cpp
+++ b/gfx/2d/ScaledFontWin.cpp
@@ -6,23 +6,19 @@
 
 #include "ScaledFontWin.h"
 #include "UnscaledFontGDI.h"
 
 #include "AutoHelpersWin.h"
 #include "Logging.h"
 #include "nsString.h"
 
-#ifdef USE_SKIA
-#  include "skia/include/ports/SkTypeface_win.h"
-#endif
+#include "skia/include/ports/SkTypeface_win.h"
 
-#ifdef USE_CAIRO_SCALED_FONT
-#  include "cairo-win32.h"
-#endif
+#include "cairo-win32.h"
 
 #include "HelpersWinFonts.h"
 
 namespace mozilla {
 namespace gfx {
 
 ScaledFontWin::ScaledFontWin(const LOGFONT* aFont,
                              const RefPtr<UnscaledFont>& aUnscaledFont,
@@ -104,26 +100,22 @@ already_AddRefed<ScaledFont> UnscaledFon
   return MakeAndAddRef<ScaledFontWin>(
       reinterpret_cast<const LOGFONT*>(aInstanceData), this, aGlyphSize);
 }
 
 AntialiasMode ScaledFontWin::GetDefaultAAMode() {
   return GetSystemDefaultAAMode();
 }
 
-#ifdef USE_SKIA
 SkTypeface* ScaledFontWin::CreateSkTypeface() {
   return SkCreateTypefaceFromLOGFONT(mLogFont);
 }
-#endif
 
-#ifdef USE_CAIRO_SCALED_FONT
 cairo_font_face_t* ScaledFontWin::CreateCairoFontFace(
     cairo_font_options_t* aFontOptions) {
   if (mLogFont.lfFaceName[0] == 0) {
     return nullptr;
   }
   return cairo_win32_font_face_create_for_logfontw(&mLogFont);
 }
-#endif
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/2d/ScaledFontWin.h
+++ b/gfx/2d/ScaledFontWin.h
@@ -20,29 +20,23 @@ class ScaledFontWin : public ScaledFontB
                 Float aSize);
 
   FontType GetType() const override { return FontType::GDI; }
 
   bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override;
 
   AntialiasMode GetDefaultAAMode() override;
 
-#ifdef USE_SKIA
   SkTypeface* CreateSkTypeface() override;
-#endif
 
  protected:
-#ifdef USE_CAIRO_SCALED_FONT
   cairo_font_face_t* CreateCairoFontFace(
       cairo_font_options_t* aFontOptions) override;
-#endif
 
  private:
-#ifdef USE_SKIA
   friend class DrawTargetSkia;
-#endif
   LOGFONT mLogFont;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_SCALEDFONTWIN_H_ */
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -932,19 +932,16 @@ set_define("MOZ_WEBSPEECH_TEST_BACKEND",
 # Enable IPDL's "expensive" unit tests
 # ==============================================================
 option("--enable-ipdl-tests", help="Enable expensive IPDL tests")
 
 set_config("MOZ_IPDL_TESTS", depends_if("--enable-ipdl-tests")(lambda _: True))
 
 # Graphics
 # ==============================================================
-set_define("USE_SKIA", True)
-
-
 @depends(target, milestone)
 def skia_pdf_default(target, milestone):
     return milestone.is_nightly and target.os != "WINNT"
 
 
 option("--enable-skia-pdf", default=skia_pdf_default, help="{Enable|Disable} Skia PDF")
 
 set_config("MOZ_ENABLE_SKIA_PDF", True, when="--enable-skia-pdf")