am f3fa0712: am 93573e91: Merge "Treat composition frames with no layers as using GLES composition" into klp-dev

* commit 'f3fa0712282e760c316f44cba05f884f9399b98f':
  Treat composition frames with no layers as using GLES composition
This commit is contained in:
Jesse Hall 2013-10-02 09:57:03 -07:00 committed by Android Git Automerger
commit fee52e20b9
2 changed files with 10 additions and 1 deletions

View File

@ -610,6 +610,10 @@ status_t HWComposer::prepare() {
// here we're just making sure that "skip" layers are set // here we're just making sure that "skip" layers are set
// to HWC_FRAMEBUFFER and we're also counting how many layers // to HWC_FRAMEBUFFER and we're also counting how many layers
// we have of each type. // we have of each type.
//
// If there are no window layers, we treat the display has having FB
// composition, because SurfaceFlinger will use GLES to draw the
// wormhole region.
for (size_t i=0 ; i<mNumDisplays ; i++) { for (size_t i=0 ; i<mNumDisplays ; i++) {
DisplayData& disp(mDisplayData[i]); DisplayData& disp(mDisplayData[i]);
disp.hasFbComp = false; disp.hasFbComp = false;
@ -631,6 +635,11 @@ status_t HWComposer::prepare() {
disp.hasOvComp = true; disp.hasOvComp = true;
} }
} }
if (disp.list->numHwLayers == (disp.framebufferTarget ? 1 : 0)) {
disp.hasFbComp = true;
}
} else {
disp.hasFbComp = true;
} }
} }
} }

View File

@ -1531,7 +1531,7 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
HWComposer::LayerListIterator cur = hwc.begin(id); HWComposer::LayerListIterator cur = hwc.begin(id);
const HWComposer::LayerListIterator end = hwc.end(id); const HWComposer::LayerListIterator end = hwc.end(id);
const bool hasGlesComposition = hwc.hasGlesComposition(id) || (cur==end); bool hasGlesComposition = hwc.hasGlesComposition(id);
if (hasGlesComposition) { if (hasGlesComposition) {
if (!hw->makeCurrent(mEGLDisplay, mEGLContext)) { if (!hw->makeCurrent(mEGLDisplay, mEGLContext)) {
ALOGW("DisplayDevice::makeCurrent failed. Aborting surface composition for display %s", ALOGW("DisplayDevice::makeCurrent failed. Aborting surface composition for display %s",