Merge "SystemUI: Disable HW acceleration for status bar" into ics-mr0
This commit is contained in:
@@ -118,15 +118,20 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac
|
|||||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||||
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
|
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
|
||||||
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
|
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
|
||||||
PixelFormat.OPAQUE);
|
// We use a pixel format of RGB565 for the status bar to save memory bandwidth and
|
||||||
|
// to ensure that the layer can be handled by HWComposer. On some devices the
|
||||||
|
// HWComposer is unable to handle SW-rendered RGBX_8888 layers.
|
||||||
|
PixelFormat.RGB_565);
|
||||||
|
|
||||||
// the status bar should be in an overlay if possible
|
// the status bar should be in an overlay if possible
|
||||||
final Display defaultDisplay
|
final Display defaultDisplay
|
||||||
= ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
|
= ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
|
||||||
.getDefaultDisplay();
|
.getDefaultDisplay();
|
||||||
if (ActivityManager.isHighEndGfx(defaultDisplay)) {
|
|
||||||
lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
|
// We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies
|
||||||
}
|
// very little screen real-estate and is updated fairly frequently. By using CPU rendering
|
||||||
|
// for the status bar, we prevent the GPU from having to wake up just to do these small
|
||||||
|
// updates, which should help keep power consumption down.
|
||||||
|
|
||||||
lp.gravity = getStatusBarGravity();
|
lp.gravity = getStatusBarGravity();
|
||||||
lp.setTitle("StatusBar");
|
lp.setTitle("StatusBar");
|
||||||
|
|||||||
Reference in New Issue
Block a user