diff options
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index 2eae9c2..c67f4d8 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -188,6 +188,25 @@ void DisplayDevice::flip(const Region& dirty) const mPageFlipCount++; } +status_t DisplayDevice::prepareFrame(const HWComposer& hwc) const { + DisplaySurface::CompositionType compositionType; + bool haveGles = hwc.hasGlesComposition(mHwcDisplayId); + bool haveHwc = hwc.hasHwcComposition(mHwcDisplayId); + if (haveGles && haveHwc) { + compositionType = DisplaySurface::COMPOSITION_MIXED; + } else if (haveGles) { + compositionType = DisplaySurface::COMPOSITION_GLES; + } else if (haveHwc) { + compositionType = DisplaySurface::COMPOSITION_HWC; + } else { + // Nothing to do -- when turning the screen off we get a frame like + // this. Call it a HWC frame since we won't be doing any GLES work but + // will do a prepare/set cycle. + compositionType = DisplaySurface::COMPOSITION_HWC; + } + return mDisplaySurface->prepareFrame(compositionType); +} + void DisplayDevice::swapBuffers(HWComposer& hwc) const { // We need to call eglSwapBuffers() unless: // (a) there was no GLES composition this frame, or |