Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 7d874094c07dc39e82478bf420b3f5cd18c76d7b 1 parent 56b22d6
Jeykumar Sankaran authored Whitehawkx committed
8 services/surfaceflinger/DisplayHardware/HWComposer.cpp
View
@@ -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;
36 services/surfaceflinger/SurfaceFlinger.cpp
View
@@ -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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.