Commit 22a56acc authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Modernize CoreText version checks

CTGetCoreTextVersion is deprecated as of macOS Big Sur. The recommended
replacement is normal version checks, so migrate to the standard
Chromium base::mac::IsOS() checks.

Bug: none
Change-Id: I782dd440d7fd04829eae4860cb57c7f7d1ffdb73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351161
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797229}
parent d1955fbf
......@@ -4,27 +4,18 @@
#include "third_party/blink/renderer/platform/fonts/mac/core_text_font_format_support.h"
#include <CoreText/CoreText.h>
#include "base/mac/mac_util.h"
namespace blink {
// Compare CoreText.h in an up to date SDK, redefining here since we don't seem
// to have access to this value when building against the 10.10 SDK in our
// standard Chrome build configuration.
// static const uint32_t kBlinkLocalCTVersionNumber10_12 = 0x00090000;
static const uint32_t kBlinkLocalCTVersionNumber10_13 = 0x000A0000;
static const uint32_t kBlinkLocalCTVersionNumber10_14 = 0x000B0000;
bool CoreTextVersionSupportsVariations() {
return &CTGetCoreTextVersion &&
CTGetCoreTextVersion() >= kBlinkLocalCTVersionNumber10_14;
return base::mac::IsAtLeastOS10_14();
}
// CoreText versions below 10.13 display COLR cpal as black/foreground-color
// glyphs and do not interpret color glyph layers correctly.
bool CoreTextVersionSupportsColrCpal() {
return &CTGetCoreTextVersion &&
CTGetCoreTextVersion() >= kBlinkLocalCTVersionNumber10_13;
return base::mac::IsAtLeastOS10_13();
}
} // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment