This repository was archived by the owner on Jul 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed
common/shared/org/mozilla/vrbrowser Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,7 @@ protected void onCreate(Bundle savedInstanceState) {
273
273
274
274
protected void initializeWidgets () {
275
275
UISurfaceTextureRenderer .setUseHardwareAcceleration (SettingsStore .getInstance (getBaseContext ()).isUIHardwareAccelerationEnabled ());
276
+ UISurfaceTextureRenderer .setRenderActive (true );
276
277
mWindows = new Windows (this );
277
278
mWindows .setDelegate (new Windows .Delegate () {
278
279
@ Override
@@ -360,6 +361,7 @@ protected void onStart() {
360
361
SettingsStore .getInstance (getBaseContext ()).setPid (Process .myPid ());
361
362
super .onStart ();
362
363
TelemetryWrapper .start ();
364
+ UISurfaceTextureRenderer .setRenderActive (true );
363
365
}
364
366
365
367
@ Override
@@ -369,6 +371,7 @@ protected void onStop() {
369
371
370
372
TelemetryWrapper .stop ();
371
373
GleanMetricsService .sessionStop ();
374
+ UISurfaceTextureRenderer .setRenderActive (false );
372
375
}
373
376
374
377
@ Override
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ SettingsStore getInstance(final @NonNull Context aContext) {
51
51
public final static boolean CONSOLE_LOGS_DEFAULT = false ;
52
52
public final static boolean ENV_OVERRIDE_DEFAULT = false ;
53
53
public final static boolean MULTIPROCESS_DEFAULT = true ;
54
- public final static boolean UI_HARDWARE_ACCELERATION_DEFAULT = false ;
54
+ public final static boolean UI_HARDWARE_ACCELERATION_DEFAULT = true ;
55
55
public final static boolean PERFORMANCE_MONITOR_DEFAULT = true ;
56
56
public final static boolean DRM_PLAYBACK_DEFAULT = false ;
57
57
public final static boolean TRACKING_DEFAULT = true ;
Original file line number Diff line number Diff line change 12
12
import android .graphics .SurfaceTexture ;
13
13
import android .view .Surface ;
14
14
15
+ import androidx .annotation .Nullable ;
16
+
15
17
public class UISurfaceTextureRenderer {
16
18
private int mTextureWidth ;
17
19
private int mTextureHeight ;
18
20
private SurfaceTexture mSurfaceTexture ;
19
21
private Surface mSurface ;
20
22
private Canvas mSurfaceCanvas ;
21
23
private static boolean sUseHarwareAcceleration ;
24
+ private static boolean sRenderActive = true ;
22
25
23
26
public static void setUseHardwareAcceleration (boolean aEnabled ) {
24
27
sUseHarwareAcceleration = aEnabled ;
25
28
}
26
29
30
+ public static void setRenderActive (boolean aActive ) {
31
+ sRenderActive = aActive ;
32
+ }
33
+
27
34
UISurfaceTextureRenderer (SurfaceTexture aTexture , int aWidth , int aHeight ) {
28
35
mTextureWidth = aWidth ;
29
36
mTextureHeight = aHeight ;
@@ -63,8 +70,12 @@ void release() {
63
70
mSurfaceTexture = null ;
64
71
}
65
72
73
+ @ Nullable
66
74
Canvas drawBegin () {
67
75
mSurfaceCanvas = null ;
76
+ if (!sRenderActive ) {
77
+ return null ;
78
+ }
68
79
if (mSurface != null ) {
69
80
try {
70
81
if (sUseHarwareAcceleration ) {
Original file line number Diff line number Diff line change 49
49
<string name =" settings_key_bookmarks_sync" translatable =" false" >settings_key_bookmarks_sync</string >
50
50
<string name =" settings_key_history_sync" translatable =" false" >settings_key_history_sync</string >
51
51
<string name =" settings_key_whats_new_displayed" translatable =" false" >settings_key_whats_new_displayed</string >
52
- <string name =" settings_key_ui_hardware_acceleration" translatable =" false" >settings_key_ui_hardware_acceleration </string >
52
+ <string name =" settings_key_ui_hardware_acceleration" translatable =" false" >settings_key_ui_hardware_acceleration_v2 </string >
53
53
<string name =" settings_key_fxa_last_sync" translatable =" false" >settings_key_fxa_last_sync</string >
54
54
<string name =" settings_key_restore_tabs" translatable =" false" >settings_key_restore_tabs</string >
55
55
<string name =" environment_override_help_url" translatable =" false" >https://github.com/MozillaReality/FirefoxReality/wiki/Environments</string >
You can’t perform that action at this time.
0 commit comments