Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efaf9fd7 authored by Tanguy Pruvot's avatar Tanguy Pruvot
Browse files

Add a new 16bit transparency performance option

require frameworks patch http://review.cyanogenmod.com/8437

Change-Id: Ideff2ab1f9f323d84bbc220eeee85aa4b91e9498
parent 6b93430d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -310,6 +310,10 @@
    <string name="pref_use_dithering_title">Activer le tramage</string>
    <string name="pref_use_dithering_summary">Le tramage (dithering) améliore la qualité des images au détriment des performances (nécessite un redémarrage)</string>

    <!-- Performance Settings : 16bpp Alpha -->
    <string name="pref_use_16bpp_alpha_title">Transparence 16bits</string>
    <string name="pref_use_16bpp_alpha_summary">Utiliser le mode 16 bits améliore la vitesse de défilement et des animations, mais peut affecter l\'affichage des éléments transparents (nécessite un redémarrage)</string>

    <!-- Performance Settings : Purgeable Assets -->
    <string name="pref_purgeable_assets_title">Purge des bitmaps</string>
    <string name="pref_purgeable_assets_summary">Le système peut libérer plus de RAM si la mémoire des bitmaps peut être réclamée (nécessite un redémarrage)</string>
+4 −0
Original line number Diff line number Diff line
@@ -405,6 +405,10 @@
    <string name="pref_use_dithering_title">Enable surface dithering</string>
    <string name="pref_use_dithering_summary">Dithering surfaces improves image quality at the cost of performance (requires reboot)</string>

    <!-- Performance Settings : 16bpp Alpha -->
    <string name="pref_use_16bpp_alpha_title">Use 16bit transparency</string>
    <string name="pref_use_16bpp_alpha_summary">Using 16bit transparency can improve scrolling performance, but may cause visual artifacts (requires reboot)</string>

    <!-- Performance Settings : Purgeable Assets -->
    <string name="pref_purgeable_assets_title">Allow purging of assets</string>
    <string name="pref_purgeable_assets_summary">System can free more RAM when needed if asset bitmap memory can be reclaimed (requires reboot)</string>
+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,10 @@
            android:title="@string/pref_use_dithering_title"
            android:summary="@string/pref_use_dithering_summary" />

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

        <CheckBoxPreference android:key="pref_purgeable_assets"
            android:title="@string/pref_purgeable_assets_title"
            android:summary="@string/pref_purgeable_assets_summary" />
+16 −0
Original line number Diff line number Diff line
@@ -69,6 +69,10 @@ public class PerformanceSettingsActivity extends PreferenceActivity implements P
    
    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 static final String PURGEABLE_ASSETS_PREF = "pref_purgeable_assets";

    private static final String PURGEABLE_ASSETS_PERSIST_PROP = "persist.sys.purgeable_assets";
@@ -89,6 +93,8 @@ public class PerformanceSettingsActivity extends PreferenceActivity implements P

    private CheckBoxPreference mUseDitheringPref;

    private CheckBoxPreference mUse16bppAlphaPref;

    private CheckBoxPreference mPurgeableAssetsPref;

    private CheckBoxPreference mLockHomePref;
@@ -132,6 +138,10 @@ public class PerformanceSettingsActivity extends PreferenceActivity implements P
        String useDithering = SystemProperties.get(USE_DITHERING_PERSIST_PROP, USE_DITHERING_DEFAULT);
        mUseDitheringPref.setChecked("1".equals(useDithering));

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

        mPurgeableAssetsPref = (CheckBoxPreference) prefSet.findPreference(PURGEABLE_ASSETS_PREF);
        String purgeableAssets = SystemProperties.get(PURGEABLE_ASSETS_PERSIST_PROP, PURGEABLE_ASSETS_DEFAULT);
        mPurgeableAssetsPref.setChecked("1".equals(purgeableAssets));
@@ -177,6 +187,12 @@ public class PerformanceSettingsActivity extends PreferenceActivity implements P
            return true;
        }

        if (preference == mUse16bppAlphaPref) {
            SystemProperties.set(USE_16BPP_ALPHA_PROP,
                    mUse16bppAlphaPref.isChecked() ? "1" : "0");
            return true;
        }

        if (preference == mPurgeableAssetsPref) {
            SystemProperties.set(PURGEABLE_ASSETS_PERSIST_PROP,
                    mPurgeableAssetsPref.isChecked() ? "1" : "0");