diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 312793af9931b..0000000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# See Dependabot documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - labels: - - "autosubmit" diff --git a/DEPS b/DEPS index 7062dc42d418f..4edd9b95c64c2 100644 --- a/DEPS +++ b/DEPS @@ -96,7 +96,7 @@ vars = { "checkout_llvm": False, # Setup Git hooks by default. - "setup_githooks": True, + "setup_githooks": False, # Upstream URLs for third party dependencies, used in # determining common ancestor commit for vulnerability scanning diff --git a/third_party/txt/src/minikin/FontCollection.cpp b/third_party/txt/src/minikin/FontCollection.cpp index 91d1ac295cdc1..69a0f873049ed 100644 --- a/third_party/txt/src/minikin/FontCollection.cpp +++ b/third_party/txt/src/minikin/FontCollection.cpp @@ -509,7 +509,9 @@ void FontCollection::itemize(const uint16_t* string, if (!shouldContinueRun) { const std::shared_ptr& family = getFamilyForChar( ch, isVariationSelector(nextCh) ? nextCh : 0, langListId, variant); - if (utf16Pos == 0 || family.get() != lastFamily) { + if (utf16Pos == 0 || family.get() != lastFamily || + (!(U_GET_GC_MASK(prevCh) & U_GC_L_MASK) && + (U_GET_GC_MASK(ch) & U_GC_L_MASK))) { size_t start = utf16Pos; // Workaround for combining marks and emoji modifiers until we implement // per-cluster font selection: if a combining mark or an emoji modifier @@ -528,8 +530,8 @@ void FontCollection::itemize(const uint16_t* string, } start -= prevChLength; } - result->push_back( - {family->getClosestMatch(style), static_cast(start), 0}); + result->push_back({family->getClosestMatch(style, ch, variant), + static_cast(start), 0}); run = &result->back(); lastFamily = family.get(); } diff --git a/third_party/txt/src/minikin/FontFamily.cpp b/third_party/txt/src/minikin/FontFamily.cpp index cf5a623c56132..a507ffeefa1d6 100644 --- a/third_party/txt/src/minikin/FontFamily.cpp +++ b/third_party/txt/src/minikin/FontFamily.cpp @@ -146,15 +146,28 @@ static FontFakery computeFakery(FontStyle wanted, FontStyle actual) { return FontFakery(isFakeBold, isFakeItalic); } -FakedFont FontFamily::getClosestMatch(FontStyle style) const { +FakedFont FontFamily::getClosestMatch( + FontStyle style, + uint32_t codepoint /* = 0 */, + uint32_t variationSelector /* = 0 */) const { const Font* bestFont = nullptr; - int bestMatch = 0; + int bestMatch = INT_MAX; for (size_t i = 0; i < mFonts.size(); i++) { const Font& font = mFonts[i]; int match = computeMatch(font.style, style); - if (i == 0 || match < bestMatch) { - bestFont = &font; - bestMatch = match; + bool result = false; + if (codepoint != 0) { + hb_font_t* hbFont = getHbFontLocked(font.typeface.get()); + uint32_t unusedGlyph = 0; + result = + hb_font_get_glyph(hbFont, codepoint, variationSelector, &unusedGlyph); + hb_font_destroy(hbFont); + } + if (codepoint == 0 || (codepoint != 0 && result)) { + if (match < bestMatch) { + bestFont = &font; + bestMatch = match; + } } } if (bestFont != nullptr) { diff --git a/third_party/txt/src/minikin/FontFamily.h b/third_party/txt/src/minikin/FontFamily.h index b82e80ea222da..aea4dcd04fdea 100644 --- a/third_party/txt/src/minikin/FontFamily.h +++ b/third_party/txt/src/minikin/FontFamily.h @@ -140,7 +140,9 @@ class FontFamily { static bool analyzeStyle(const std::shared_ptr& typeface, int* weight, bool* italic); - FakedFont getClosestMatch(FontStyle style) const; + FakedFont getClosestMatch(FontStyle style, + uint32_t codepoint = 0, + uint32_t variationSelector = 0) const; uint32_t langId() const { return mLangId; } int variant() const { return mVariant; } diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 96c1b1b325331..069791785f54c 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -243,6 +243,27 @@ void FontCollection::SortSkTypefaces( std::sort( sk_typefaces.begin(), sk_typefaces.end(), [](const sk_sp& a, const sk_sp& b) { + { + // A workaround to prevent emoji fonts being selected for normal text + // when normal and emoji fonts are mixed in the same font family. + bool a_isEmojiFont = false; + bool b_isEmojiFont = false; + SkString postScriptName; + a->getPostScriptName(&postScriptName); + if (postScriptName.contains("Emoji")) { + a_isEmojiFont = true; + } + b->getPostScriptName(&postScriptName); + if (postScriptName.contains("Emoji")) { + b_isEmojiFont = true; + } + if (a_isEmojiFont && !b_isEmojiFont) { + return false; + } else if (!a_isEmojiFont && b_isEmojiFont) { + return true; + } + } + SkFontStyle a_style = a->fontStyle(); SkFontStyle b_style = b->fontStyle(); diff --git a/third_party/txt/src/txt/platform_linux.cc b/third_party/txt/src/txt/platform_linux.cc index 86dc2132c2b9d..74ccd820cf838 100644 --- a/third_party/txt/src/txt/platform_linux.cc +++ b/third_party/txt/src/txt/platform_linux.cc @@ -13,12 +13,12 @@ namespace txt { std::vector GetDefaultFontFamilies() { - return {"Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"}; + return {"TizenDefaultFont", "SamsungOneUI"}; } sk_sp GetDefaultFontManager(uint32_t font_initialization_data) { #ifdef FLUTTER_USE_FONTCONFIG - return SkFontMgr_New_FontConfig(nullptr); + return SkFontMgr::RefDefault(); #else return SkFontMgr_New_Custom_Directory("/usr/share/fonts/"); #endif diff --git a/tools/gn b/tools/gn index 27f65988f53b3..f76ba5f19c486 100755 --- a/tools/gn +++ b/tools/gn @@ -96,17 +96,7 @@ def cpu_for_target_arch(arch): def is_host_build(args): # If target_os == None, then this is a host build. - if args.target_os is None: - return True - # For linux arm64 builds, we cross compile from x64 hosts, so the - # target_os='linux' and linux-cpu='arm64' - if args.target_os == 'linux' and args.linux_cpu == 'arm64': - return True - # The Mac and host targets are redundant. Again, necessary to disambiguate - # during cross-compilation. - if args.target_os == 'mac': - return True - return False + return args.target_os is None # Determines whether a prebuilt Dart SDK can be used instead of building one. @@ -435,7 +425,8 @@ def to_gn_args(args): else: gn_args['skia_use_gl'] = args.target_os != 'fuchsia' - if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia']: + if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia', + 'linux']: # OpenGL is deprecated on macOS > 10.11. # This is not necessarily needed but enabling this until we have a way to # build a macOS metal only shell and a gl only shell. @@ -529,8 +520,8 @@ def to_gn_args(args): # Enable pointer compression on 64-bit mobile targets. iOS is excluded due to # its inability to allocate address space without allocating memory. - if args.target_os in ['android'] and gn_args['target_cpu'] in ['x64', 'arm64' - ]: + if args.target_os in ['android', 'linux' + ] and gn_args['target_cpu'] in ['x64', 'arm64']: gn_args['dart_use_compressed_pointers'] = True if args.fuchsia_target_api_level is not None: @@ -541,6 +532,10 @@ def to_gn_args(args): 'fuchsia/target_api_level')) as file: gn_args['fuchsia_target_api_level'] = int(file.read().strip()) + # Don't use the default Linux sysroot when buliding for Linux on macOS. + if sys.platform == 'darwin' and args.target_os == 'linux': + gn_args['use_default_linux_sysroot'] = False + # Flags for Dart features: if args.use_mallinfo2: gn_args['dart_use_mallinfo2'] = args.use_mallinfo2 @@ -562,7 +557,7 @@ def to_gn_args(args): # There is a special case for Android on Windows because there we _only_ build # gen_snapshot, but the build defines otherwise make it look like the build is # for a host Windows build and make GN think we will be building ANGLE. - if is_host_build(args) or (args.target_os == 'android' and + if is_host_build(args) or (args.target_os == 'linux' and get_host_os() == 'win'): # Do not build unnecessary parts of the ANGLE tree. gn_args['angle_build_all'] = False