better workaround for bug: 6020860

this prevents the GPU from running when composition
is fully handled by overlays. this should improve
animations a bit.

Change-Id: If4ae584b7a3976e6bdd36e318686ac3940b6b075
This commit is contained in:
Mathias Agopian 2012-03-29 12:23:51 -07:00
parent 9e0b1f880b
commit 4b2ba53423
1 changed files with 17 additions and 6 deletions

View File

@ -1013,18 +1013,29 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty)
drawWormhole();
}
// FIXME: workaroud for b/6020860
glEnable(GL_SCISSOR_TEST);
glScissor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
// end-workaround
/*
* and then, render the layers targeted at the framebuffer
*/
hwc_layer_t* const cur(hwc.getLayers());
const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
size_t count = layers.size();
// FIXME: workaround for b/6020860
if (hw.getFlags() & DisplayHardware::BUFFER_PRESERVED) {
for (size_t i=0 ; i<count ; i++) {
if (cur && (cur[i].compositionType == HWC_FRAMEBUFFER)) {
glEnable(GL_SCISSOR_TEST);
glScissor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
break;
}
}
}
// FIXME: bug6020860 for b/6020860
for (size_t i=0 ; i<count ; i++) {
if (cur && (cur[i].compositionType != HWC_FRAMEBUFFER)) {
continue;