Skip to content

Commit

Permalink
Bug 1882945 - Adjust ScaledFontMac.cpp after bug 1856035. r=gfx-revie…
Browse files Browse the repository at this point in the history
…wers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D203222
  • Loading branch information
glandium committed Mar 1, 2024
1 parent eb54f2a commit 59a6582
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gfx/2d/ScaledFontMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include "ScaledFontMac.h"
#include "UnscaledFontMac.h"
#include "mozilla/webrender/WebRenderTypes.h"
#include "nsCocoaFeatures.h"
#ifdef MOZ_WIDGET_COCOA
# include "nsCocoaFeatures.h"
#endif
#include "PathSkia.h"
#include "skia/include/core/SkPaint.h"
#include "skia/include/core/SkPath.h"
Expand Down Expand Up @@ -73,6 +75,7 @@ class AutoRelease final {
CTFontRef CreateCTFontFromCGFontWithVariations(CGFontRef aCGFont, CGFloat aSize,
bool aInstalledFont,
CTFontDescriptorRef aFontDesc) {
#ifdef MOZ_WIDGET_COCOA
// New implementation (see bug 1856035) for macOS 13+.
if (nsCocoaFeatures::OnVenturaOrLater()) {
// Create CTFont, applying any descriptor that was passed (used by
Expand All @@ -96,6 +99,7 @@ CTFontRef CreateCTFontFromCGFontWithVariations(CGFontRef aCGFont, CGFloat aSize,
// No variations to set, just return the default CTFont.
return ctFont.forget();
}
#endif

// Older implementation used up to macOS 12.
CTFontRef ctFont;
Expand Down

0 comments on commit 59a6582

Please sign in to comment.