Bug 1869353 - Add a pref to disable Android SurfaceControl rendering path. r=geckoview-reviewers,jonalmeida

Differential Revision: https://phabricator.services.mozilla.com/D196069
This commit is contained in:
Jamie Nicol 2023-12-11 18:15:34 +00:00
parent 53a6546034
commit 69bcb46e73
2 changed files with 10 additions and 2 deletions

View File

@ -15859,6 +15859,12 @@
#endif
mirror: always
# Whether to render in to a child SurfaceControl rather than directly into the SurfaceView
- name: widget.android.use-surfacecontrol
type: bool
value: true
mirror: once
#---------------------------------------------------------------------------
# Prefs starting with "zoom."
#---------------------------------------------------------------------------

View File

@ -1290,8 +1290,10 @@ class LayerViewSupport final
mY = aY;
mWidth = aWidth;
mHeight = aHeight;
mSurfaceControl =
java::sdk::SurfaceControl::GlobalRef::From(aSurfaceControl);
if (StaticPrefs::widget_android_use_surfacecontrol_AtStartup()) {
mSurfaceControl =
java::sdk::SurfaceControl::GlobalRef::From(aSurfaceControl);
}
if (mSurfaceControl) {
// When using SurfaceControl, we create a child Surface to render in to
// rather than rendering directly in to the Surface provided by the