Add developer setting to set the default GPU renderer.
Test: manual on-device testing Bug: 35345959 Change-Id: Ia48c2c7935ceab894467b9e1e040785db28644a5
This commit is contained in:
@@ -355,6 +355,12 @@
|
|||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/simulate_color_space" />
|
android:title="@string/simulate_color_space" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:key="debug_hw_renderer"
|
||||||
|
android:title="@string/debug_hw_renderer"
|
||||||
|
android:entries="@array/debug_hw_renderer_entries"
|
||||||
|
android:entryValues="@array/debug_hw_renderer_values" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:key="media_category"
|
<PreferenceCategory android:key="media_category"
|
||||||
|
@@ -159,6 +159,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
private static final String SHOW_HW_SCREEN_UPDATES_KEY = "show_hw_screen_udpates";
|
private static final String SHOW_HW_SCREEN_UPDATES_KEY = "show_hw_screen_udpates";
|
||||||
private static final String SHOW_HW_LAYERS_UPDATES_KEY = "show_hw_layers_udpates";
|
private static final String SHOW_HW_LAYERS_UPDATES_KEY = "show_hw_layers_udpates";
|
||||||
private static final String DEBUG_HW_OVERDRAW_KEY = "debug_hw_overdraw";
|
private static final String DEBUG_HW_OVERDRAW_KEY = "debug_hw_overdraw";
|
||||||
|
private static final String DEBUG_HW_RENDERER_KEY = "debug_hw_renderer";
|
||||||
private static final String DEBUG_LAYOUT_KEY = "debug_layout";
|
private static final String DEBUG_LAYOUT_KEY = "debug_layout";
|
||||||
private static final String FORCE_RTL_LAYOUT_KEY = "force_rtl_layout_all_locales";
|
private static final String FORCE_RTL_LAYOUT_KEY = "force_rtl_layout_all_locales";
|
||||||
private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale";
|
private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale";
|
||||||
@@ -304,6 +305,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
private SwitchPreference mDebugLayout;
|
private SwitchPreference mDebugLayout;
|
||||||
private SwitchPreference mForceRtlLayout;
|
private SwitchPreference mForceRtlLayout;
|
||||||
private ListPreference mDebugHwOverdraw;
|
private ListPreference mDebugHwOverdraw;
|
||||||
|
private ListPreference mDebugHwRenderer;
|
||||||
private ListPreference mLogdSize;
|
private ListPreference mLogdSize;
|
||||||
private ListPreference mLogpersist;
|
private ListPreference mLogpersist;
|
||||||
private ListPreference mUsbConfiguration;
|
private ListPreference mUsbConfiguration;
|
||||||
@@ -469,6 +471,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
mDebugLayout = findAndInitSwitchPref(DEBUG_LAYOUT_KEY);
|
mDebugLayout = findAndInitSwitchPref(DEBUG_LAYOUT_KEY);
|
||||||
mForceRtlLayout = findAndInitSwitchPref(FORCE_RTL_LAYOUT_KEY);
|
mForceRtlLayout = findAndInitSwitchPref(FORCE_RTL_LAYOUT_KEY);
|
||||||
mDebugHwOverdraw = addListPreference(DEBUG_HW_OVERDRAW_KEY);
|
mDebugHwOverdraw = addListPreference(DEBUG_HW_OVERDRAW_KEY);
|
||||||
|
mDebugHwRenderer = addListPreference(DEBUG_HW_RENDERER_KEY);
|
||||||
mWifiDisplayCertification = findAndInitSwitchPref(WIFI_DISPLAY_CERTIFICATION_KEY);
|
mWifiDisplayCertification = findAndInitSwitchPref(WIFI_DISPLAY_CERTIFICATION_KEY);
|
||||||
mWifiVerboseLogging = findAndInitSwitchPref(WIFI_VERBOSE_LOGGING_KEY);
|
mWifiVerboseLogging = findAndInitSwitchPref(WIFI_VERBOSE_LOGGING_KEY);
|
||||||
mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
|
mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
|
||||||
@@ -779,6 +782,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
updateShowHwScreenUpdatesOptions();
|
updateShowHwScreenUpdatesOptions();
|
||||||
updateShowHwLayersUpdatesOptions();
|
updateShowHwLayersUpdatesOptions();
|
||||||
updateDebugHwOverdrawOptions();
|
updateDebugHwOverdrawOptions();
|
||||||
|
updateDebugHwRendererOptions();
|
||||||
updateDebugLayoutOptions();
|
updateDebugLayoutOptions();
|
||||||
updateAnimationScaleOptions();
|
updateAnimationScaleOptions();
|
||||||
updateOverlayDisplayDevicesOptions();
|
updateOverlayDisplayDevicesOptions();
|
||||||
@@ -1323,6 +1327,31 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
updateDebugHwOverdrawOptions();
|
updateDebugHwOverdrawOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateDebugHwRendererOptions() {
|
||||||
|
String value = SystemProperties.get(ThreadedRenderer.DEBUG_RENDERER_PROPERTY);
|
||||||
|
if (value == null) {
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
CharSequence[] values = mDebugHwRenderer.getEntryValues();
|
||||||
|
for (int i = 0; i < values.length; i++) {
|
||||||
|
if (value.contentEquals(values[i])) {
|
||||||
|
mDebugHwRenderer.setValueIndex(i);
|
||||||
|
mDebugHwRenderer.setSummary(mDebugHwRenderer.getEntries()[i]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mDebugHwRenderer.setValueIndex(0);
|
||||||
|
mDebugHwRenderer.setSummary(mDebugHwRenderer.getEntries()[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeDebugHwRendererOptions(Object newValue) {
|
||||||
|
SystemProperties.set(ThreadedRenderer.DEBUG_RENDERER_PROPERTY,
|
||||||
|
newValue == null ? "" : newValue.toString());
|
||||||
|
pokeSystemProperties();
|
||||||
|
updateDebugHwRendererOptions();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateDebugLayoutOptions() {
|
private void updateDebugLayoutOptions() {
|
||||||
updateSwitchPreference(mDebugLayout,
|
updateSwitchPreference(mDebugLayout,
|
||||||
SystemProperties.getBoolean(View.DEBUG_LAYOUT_PROPERTY, false));
|
SystemProperties.getBoolean(View.DEBUG_LAYOUT_PROPERTY, false));
|
||||||
@@ -2544,6 +2573,9 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
} else if (preference == mDebugHwOverdraw) {
|
} else if (preference == mDebugHwOverdraw) {
|
||||||
writeDebugHwOverdrawOptions(newValue);
|
writeDebugHwOverdrawOptions(newValue);
|
||||||
return true;
|
return true;
|
||||||
|
} else if (preference == mDebugHwRenderer) {
|
||||||
|
writeDebugHwRendererOptions(newValue);
|
||||||
|
return true;
|
||||||
} else if (preference == mShowNonRectClip) {
|
} else if (preference == mShowNonRectClip) {
|
||||||
writeShowNonRectClipOptions(newValue);
|
writeShowNonRectClipOptions(newValue);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user