Loading core/java/android/widget/OverScroller.java +26 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.util.Log; import android.view.ViewConfiguration; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import org.codeaurora.Performance; /** * This class encapsulates scrolling with the ability to overshoot the bounds Loading Loading @@ -601,6 +602,15 @@ public class OverScroller { private static final int CUBIC = 1; private static final int BALLISTIC = 2; /* * Perf boost related variables * Enabled/Disabled using config_enableCpuBoostForOverScrollerFling * true value turns it on, by default will be turned off */ private Performance mPerf = null; private boolean mIsPerfLockAcquired = false; private boolean mIsPerfBoostEnabled = false; static { float x_min = 0.0f; float y_min = 0.0f; Loading Loading @@ -645,6 +655,9 @@ public class OverScroller { * 39.37f // inch/meter * ppi * 0.84f; // look and feel tuning mIsPerfBoostEnabled = context.getResources().getBoolean( com.android.internal.R.bool.config_enableCpuBoostForOverScrollerFling); } void updateScroll(float q) { Loading Loading @@ -692,6 +705,11 @@ public class OverScroller { } void finish() { if (mIsPerfLockAcquired && mPerf != null) { mPerf.perfLockRelease(); mIsPerfLockAcquired = false; } mCurrentPosition = mFinal; // Not reset since WebView relies on this value for fast fling. // TODO: restore when WebView uses the fast fling implemented in this class. Loading Loading @@ -762,6 +780,14 @@ public class OverScroller { if (velocity != 0) { mDuration = mSplineDuration = getSplineFlingDuration(velocity); totalDistance = getSplineFlingDistance(velocity); if (mPerf == null && mIsPerfBoostEnabled) { mPerf = new Performance(); } if (mPerf != null) { mIsPerfLockAcquired = true; mPerf.perfLockAcquire(mDuration, mPerf.CPUS_ON_2, 0x20B, 0x30B); } } mSplineDistance = (int) (totalDistance * Math.signum(velocity)); Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1307,4 +1307,7 @@ <!-- set to false if we dont need to consider data service state to display signal strength bars --> <bool name="config_combined_signal">true</bool> <!-- Whether cpu boost is enabled for overscroller fling. --> <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> </resources> core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1765,4 +1765,7 @@ <java-symbol type="dimen" name="subtitle_shadow_radius" /> <java-symbol type="dimen" name="subtitle_shadow_offset" /> <java-symbol type="dimen" name="subtitle_outline_width" /> <!-- cpu boost for overscroller fling --> <java-symbol type="bool" name="config_enableCpuBoostForOverScrollerFling" /> </resources> Loading
core/java/android/widget/OverScroller.java +26 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.util.Log; import android.view.ViewConfiguration; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import org.codeaurora.Performance; /** * This class encapsulates scrolling with the ability to overshoot the bounds Loading Loading @@ -601,6 +602,15 @@ public class OverScroller { private static final int CUBIC = 1; private static final int BALLISTIC = 2; /* * Perf boost related variables * Enabled/Disabled using config_enableCpuBoostForOverScrollerFling * true value turns it on, by default will be turned off */ private Performance mPerf = null; private boolean mIsPerfLockAcquired = false; private boolean mIsPerfBoostEnabled = false; static { float x_min = 0.0f; float y_min = 0.0f; Loading Loading @@ -645,6 +655,9 @@ public class OverScroller { * 39.37f // inch/meter * ppi * 0.84f; // look and feel tuning mIsPerfBoostEnabled = context.getResources().getBoolean( com.android.internal.R.bool.config_enableCpuBoostForOverScrollerFling); } void updateScroll(float q) { Loading Loading @@ -692,6 +705,11 @@ public class OverScroller { } void finish() { if (mIsPerfLockAcquired && mPerf != null) { mPerf.perfLockRelease(); mIsPerfLockAcquired = false; } mCurrentPosition = mFinal; // Not reset since WebView relies on this value for fast fling. // TODO: restore when WebView uses the fast fling implemented in this class. Loading Loading @@ -762,6 +780,14 @@ public class OverScroller { if (velocity != 0) { mDuration = mSplineDuration = getSplineFlingDuration(velocity); totalDistance = getSplineFlingDistance(velocity); if (mPerf == null && mIsPerfBoostEnabled) { mPerf = new Performance(); } if (mPerf != null) { mIsPerfLockAcquired = true; mPerf.perfLockAcquire(mDuration, mPerf.CPUS_ON_2, 0x20B, 0x30B); } } mSplineDistance = (int) (totalDistance * Math.signum(velocity)); Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1307,4 +1307,7 @@ <!-- set to false if we dont need to consider data service state to display signal strength bars --> <bool name="config_combined_signal">true</bool> <!-- Whether cpu boost is enabled for overscroller fling. --> <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> </resources>
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1765,4 +1765,7 @@ <java-symbol type="dimen" name="subtitle_shadow_radius" /> <java-symbol type="dimen" name="subtitle_shadow_offset" /> <java-symbol type="dimen" name="subtitle_outline_width" /> <!-- cpu boost for overscroller fling --> <java-symbol type="bool" name="config_enableCpuBoostForOverScrollerFling" /> </resources>