diff options
author | Jeykumar Sankaran <jsanka@codeaurora.org> | 2012-08-28 17:36:26 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2012-09-18 11:34:28 -0700 |
commit | 02a96182bf09a741b7762527fad2ed84c0c7e435 (patch) | |
tree | 726fb0f71e8f595b9dc186668ea018ec9c2366dd | |
parent | 56fae2a00595ddf5b97e1faedb5e99b063e0903c (diff) | |
download | android_frameworks_native-02a96182bf09a741b7762527fad2ed84c0c7e435.tar.gz android_frameworks_native-02a96182bf09a741b7762527fad2ed84c0c7e435.tar.bz2 android_frameworks_native-02a96182bf09a741b7762527fad2ed84c0c7e435.zip |
frameworks/native: Add support for copybit in Surfaceflinger.
- Use qcomuiclearRegion to punch hole in FB if using
copybit composition
- Skip GPU drawing if layers are flagged for copybit
- Consider copybit composition while counting for
layers updating FB
Change-Id: Ieb2937d276a5018916961b43850898066a15c17e
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 8 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 36 |
2 files changed, 36 insertions, 8 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 65763db8d..93fb55b00 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -39,6 +39,9 @@ #include "LayerBase.h" #include "HWComposer.h" #include "SurfaceFlinger.h" +#ifdef QCOM_HARDWARE +#include "qcom_ui.h" +#endif namespace android { // --------------------------------------------------------------------------- @@ -179,6 +182,11 @@ status_t HWComposer::prepare() const { case HWC_FRAMEBUFFER: numFBLayers++; break; +#ifdef QCOM_HARDWARE + default: + if(qdutils::CBUtils::isUpdatingFB((int)l.compositionType)) + numFBLayers++; +#endif } } mNumOVLayers = numOVLayers; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index e3a009e22..0005505a5 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -56,6 +56,9 @@ #include "LayerDim.h" #include "LayerScreenshot.h" #include "SurfaceFlinger.h" +#ifdef QCOM_HARDWARE +#include "qcom_ui.h" +#endif #include "DisplayHardware/DisplayHardware.h" #include "DisplayHardware/HWComposer.h" @@ -68,10 +71,6 @@ #include "SecTVOutService.h" #endif -#ifdef QCOM_HARDWARE -#include <clear_regions.h> -#endif - #define EGL_VERSION_HW_ANDROID 0x3143 #define DISPLAY_COUNT 1 @@ -972,13 +971,24 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty) // remove where there are opaque FB layers. however, on some // GPUs doing a "clean slate" glClear might be more efficient. // We'll revisit later if needed. - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); + const Region region(hw.bounds()); +#ifdef QCOM_HARDWARE + if (0 != qdutils::CBUtils::qcomuiClearRegion(region, + hw.getEGLDisplay())) +#endif + { + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT); + } } else { // screen is already cleared here if (!mWormholeRegion.isEmpty()) { // can happen with SurfaceView - drawWormhole(); +#ifdef QCOM_HARDWARE + if (0 != qdutils::CBUtils::qcomuiClearRegion(mWormholeRegion, + hw.getEGLDisplay())) +#endif + drawWormhole(); } } @@ -1004,10 +1014,19 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty) && layer->isOpaque()) { // never clear the very first layer since we're // guaranteed the FB is already cleared +#ifdef QCOM_HARDWARE + if (0 != qdutils::CBUtils::qcomuiClearRegion(clip, + hw.getEGLDisplay())) +#endif layer->clearWithOpenGL(clip); } continue; } +#ifdef QCOM_HARDWARE + if (cur && (cur[i].compositionType != HWC_FRAMEBUFFER)) + continue; +#endif + // render the layer layer->draw(clip); } @@ -1016,7 +1035,8 @@ void SurfaceFlinger::composeSurfaces(const Region& dirty) const Region region(mWormholeRegion.intersect(mDirtyRegion)); if (!region.isEmpty()) { #ifdef QCOM_HARDWARE - if (0 != qdutils::qcomuiClearRegion(region, hw.getEGLDisplay())) + if (0 != qdutils::CBUtils::qcomuiClearRegion(region, + hw.getEGLDisplay())) #endif drawWormhole(); } |