Commit 6559e056 authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Remove isSwapPixelFormatToFixConvertFromTranslucentEnabled()

Use the generic way of checking if a feature flag is enabled in
CachedFeatureFlags.

There is a slight functional change: if the value is queried before
native is loaded, and then a different value is cached when native is
loaded, a second query will now give the same result returned in the
first.

Bug: 1012975
Change-Id: I314455b927d5f4a46aeb13de922682cc600e7056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079532Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745487}
parent 82140f9c
...@@ -292,16 +292,6 @@ public class CachedFeatureFlags { ...@@ -292,16 +292,6 @@ public class CachedFeatureFlags {
ChromePreferenceKeys.FLAGS_CACHED_NETWORK_SERVICE_WARM_UP_ENABLED, false); ChromePreferenceKeys.FLAGS_CACHED_NETWORK_SERVICE_WARM_UP_ENABLED, false);
} }
/**
* Returns whether to use {@link Window#setFormat()} to undo opacity change caused by
* {@link Activity#convertFromTranslucent()}.
*/
public static boolean isSwapPixelFormatToFixConvertFromTranslucentEnabled() {
return SharedPreferencesManager.getInstance().readBoolean(
ChromePreferenceKeys.FLAGS_CACHED_SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT,
true);
}
/** /**
* Caches the trial group of the reached code profiler feature to be using on next startup. * Caches the trial group of the reached code profiler feature to be using on next startup.
*/ */
......
...@@ -28,6 +28,7 @@ import org.chromium.chrome.browser.customtabs.content.TabObserverRegistrar; ...@@ -28,6 +28,7 @@ import org.chromium.chrome.browser.customtabs.content.TabObserverRegistrar;
import org.chromium.chrome.browser.customtabs.content.TabObserverRegistrar.CustomTabTabObserver; import org.chromium.chrome.browser.customtabs.content.TabObserverRegistrar.CustomTabTabObserver;
import org.chromium.chrome.browser.dependency_injection.ActivityScope; import org.chromium.chrome.browser.dependency_injection.ActivityScope;
import org.chromium.chrome.browser.flags.CachedFeatureFlags; import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.lifecycle.Destroyable;
import org.chromium.chrome.browser.lifecycle.InflationObserver; import org.chromium.chrome.browser.lifecycle.InflationObserver;
...@@ -269,13 +270,14 @@ public class SplashController ...@@ -269,13 +270,14 @@ public class SplashController
// acceleration is disabled, swapping the pixel format causes the surface to get recreated. // acceleration is disabled, swapping the pixel format causes the surface to get recreated.
// A bug fix in Android N preserves the old surface till the new one is drawn. // A bug fix in Android N preserves the old surface till the new one is drawn.
// //
// Removing tranlucency is important for performance, otherwise the windows under Chrome // Removing translucency is important for performance, otherwise the windows under Chrome
// will continue being drawn (e.g. launcher with wallpaper). Without removing translucency, // will continue being drawn (e.g. launcher with wallpaper). Without removing translucency,
// we also see visual glitches in the following cases: // we also see visual glitches in the following cases:
// - closing activity (example: https://crbug.com/856544#c41) // - closing activity (example: https://crbug.com/856544#c41)
// - send activity to the background (example: https://crbug.com/856544#c30) // - send activity to the background (example: https://crbug.com/856544#c30)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
&& CachedFeatureFlags.isSwapPixelFormatToFixConvertFromTranslucentEnabled()) { && CachedFeatureFlags.isEnabled(
ChromeFeatureList.SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT)) {
return TranslucencyRemoval.ON_SPLASH_HIDDEN; return TranslucencyRemoval.ON_SPLASH_HIDDEN;
} }
return TranslucencyRemoval.ON_SPLASH_SHOWN; return TranslucencyRemoval.ON_SPLASH_SHOWN;
......
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