Skip to content

Commit

Permalink
Revert "Remove 16bpp option"
Browse files Browse the repository at this point in the history
This reverts commit 4307fe2.
  • Loading branch information
davros- committed Jul 19, 2013
1 parent ce6ef8c commit 914853c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions res/values/strings.xml
Expand Up @@ -4764,6 +4764,10 @@
<string name="dithering_color_banding">Fix color banding (default)</string>
<string name="dithering_blur_effect">Fix color banding and blur effect</string>

<!-- Performance Settings : 16bpp Alpha -->
<string name="pref_use_16bpp_alpha_title">16bit transparency</string>
<string name="pref_use_16bpp_alpha_summary">Better graphics performance, but lower quality and may cause visual artifacts (requires reboot)</string>

<!-- Display : Rotation -->
<string name="display_rotation_title">Rotation</string>
<string name="display_rotation_disabled">Disabled</string>
Expand Down
5 changes: 5 additions & 0 deletions res/xml/performance_settings.xml
Expand Up @@ -40,6 +40,11 @@
android:title="@string/memory_management_title"
android:summary="@string/memory_management_summary" />

<CheckBoxPreference
android:key="pref_use_16bpp_alpha"
android:title="@string/pref_use_16bpp_alpha_title"
android:summary="@string/pref_use_16bpp_alpha_summary" />

<ListPreference
android:key="pref_use_dithering"
android:persistent="false"
Expand Down
23 changes: 23 additions & 0 deletions src/com/android/settings/cyanogenmod/PerformanceSettings.java
Expand Up @@ -41,8 +41,14 @@ public class PerformanceSettings extends SettingsPreferenceFragment

private static final String USE_DITHERING_DEFAULT = "1";

private static final String USE_16BPP_ALPHA_PREF = "pref_use_16bpp_alpha";

private static final String USE_16BPP_ALPHA_PROP = "persist.sys.use_16bpp_alpha";

private ListPreference mUseDitheringPref;

private CheckBoxPreference mUse16bppAlphaPref;

private AlertDialog alertDialog;

@Override
Expand All @@ -61,6 +67,10 @@ public void onCreate(Bundle savedInstanceState) {
mUseDitheringPref.setValue(useDithering);
mUseDitheringPref.setSummary(mUseDitheringPref.getEntry());

mUse16bppAlphaPref = (CheckBoxPreference) prefSet.findPreference(USE_16BPP_ALPHA_PREF);
String use16bppAlpha = SystemProperties.get(USE_16BPP_ALPHA_PROP, "0");
mUse16bppAlphaPref.setChecked("1".equals(use16bppAlpha));

/* Display the warning dialog */
alertDialog = new AlertDialog.Builder(getActivity()).create();
alertDialog.setTitle(R.string.performance_settings_warning_title);
Expand All @@ -77,6 +87,19 @@ public void onClick(DialogInterface dialog, int which) {
}
}

@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mUse16bppAlphaPref) {
SystemProperties.set(USE_16BPP_ALPHA_PROP,
mUse16bppAlphaPref.isChecked() ? "1" : "0");
} else {
// If we didn't handle it, let preferences handle it.
return super.onPreferenceTreeClick(preferenceScreen, preference);
}

return true;
}

public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mUseDitheringPref) {
String newVal = (String) newValue;
Expand Down

0 comments on commit 914853c

Please sign in to comment.