Commit fd56fc19 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Add field trial entry for CSSReducedFontLoadingInvalidations

The feature has been tested in Beta for a while but doesn't have a field
trial entry.

This patch adds the entry for sanity, and as a preparation to roll out
testing in Stable.

Bug: 441925, 1088373
Change-Id: Id7b903ea83783fcee6158fafd142feb46341389c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209539Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774863}
parent 0cc9f960
...@@ -1203,6 +1203,27 @@ ...@@ -1203,6 +1203,27 @@
] ]
} }
], ],
"CSSReducedFontLoadingInvalidations": [
{
"platforms": [
"android",
"android_weblayer",
"android_webview",
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"CSSReducedFontLoadingInvalidations"
]
}
]
}
],
"CacheStorageEagerReading": [ "CacheStorageEagerReading": [
{ {
"platforms": [ "platforms": [
......
...@@ -2038,6 +2038,14 @@ StyleDifference LayoutObject::AdjustStyleDifference( ...@@ -2038,6 +2038,14 @@ StyleDifference LayoutObject::AdjustStyleDifference(
diff.SetNeedsPaintInvalidation(); diff.SetNeedsPaintInvalidation();
} }
// TODO(1088373): Pixel_WebGLHighToLowPower fails without this. This isn't the
// right way to ensure GPU switching. Investigate and do it in the right way.
if (RuntimeEnabledFeatures::CSSReducedFontLoadingInvalidationsEnabled() &&
!diff.NeedsPaintInvalidation() && IsLayoutView() && Style() &&
!Style()->GetFont().IsFallbackValid()) {
diff.SetNeedsPaintInvalidation();
}
// The answer to layerTypeRequired() for plugins, iframes, and canvas can // The answer to layerTypeRequired() for plugins, iframes, and canvas can
// change without the actual style changing, since it depends on whether we // change without the actual style changing, since it depends on whether we
// decide to composite these elements. When the/ layer status of one of these // decide to composite these elements. When the/ layer status of one of these
......
...@@ -97,7 +97,10 @@ bool FontFallbackList::LoadingCustomFonts() const { ...@@ -97,7 +97,10 @@ bool FontFallbackList::LoadingCustomFonts() const {
} }
bool FontFallbackList::ShouldSkipDrawing() const { bool FontFallbackList::ShouldSkipDrawing() const {
DCHECK(IsValid()); // The DCHECK hit will be fixed by the runtime enabled feature below, so we
// don't fix it in the legacy code paths.
DCHECK(IsValid() || !RuntimeEnabledFeatures::
CSSReducedFontLoadingLayoutInvalidationsEnabled());
if (!has_loading_fallback_) if (!has_loading_fallback_)
return false; return false;
......
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