summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayHardware
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-09-20 17:21:56 -0700
committerMathias Agopian <mathias@google.com>2011-09-20 17:53:33 -0700
commit88cde07df05c275da4e6d5746d79847eea723855 (patch)
treee734ad7c273339d358b566b5377a91c0461aceca /services/surfaceflinger/DisplayHardware
parentd0f2f0d46114d4858cd1d3d5f6cff4f245f104b5 (diff)
downloadframeworks_base-88cde07df05c275da4e6d5746d79847eea723855.zip
frameworks_base-88cde07df05c275da4e6d5746d79847eea723855.tar.gz
frameworks_base-88cde07df05c275da4e6d5746d79847eea723855.tar.bz2
fix transition from full overlays to fb
we need to clear the whole framebuffer in that situation because we can't trust the content of the FB when partial (fb preserving) updates are used. Bug: 5318492 Change-Id: I3f0e01b0fb665a34e44d88ad9f0f54a5d990060b
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.h3
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp32
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.h5
3 files changed, 39 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
index 40a6f1e..f02c954 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -84,9 +84,10 @@ public:
status_t compositionComplete() const;
- Rect bounds() const {
+ Rect getBounds() const {
return Rect(mWidth, mHeight);
}
+ inline Rect bounds() const { return getBounds(); }
// only for debugging
int getCurrentBufferIndex() const;
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index daefd5e..e707bdc 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -40,6 +40,7 @@ namespace android {
HWComposer::HWComposer(const sp<SurfaceFlinger>& flinger)
: mFlinger(flinger),
mModule(0), mHwc(0), mList(0), mCapacity(0),
+ mNumOVLayers(0), mNumFBLayers(0),
mDpy(EGL_NO_DISPLAY), mSur(EGL_NO_SURFACE)
{
int err = hw_get_module(HWC_HARDWARE_MODULE_ID, &mModule);
@@ -98,9 +99,40 @@ status_t HWComposer::createWorkList(size_t numLayers) {
status_t HWComposer::prepare() const {
int err = mHwc->prepare(mHwc, mList);
+ if (err == NO_ERROR) {
+ size_t numOVLayers = 0;
+ size_t numFBLayers = 0;
+ size_t count = mList->numHwLayers;
+ for (size_t i=0 ; i<count ; i++) {
+ hwc_layer& l(mList->hwLayers[i]);
+ if (l.flags & HWC_SKIP_LAYER) {
+ l.compositionType = HWC_FRAMEBUFFER;
+ }
+ switch (l.compositionType) {
+ case HWC_OVERLAY:
+ numOVLayers++;
+ break;
+ case HWC_FRAMEBUFFER:
+ numFBLayers++;
+ break;
+ }
+ }
+ mNumOVLayers = numOVLayers;
+ mNumFBLayers = numFBLayers;
+ }
return (status_t)err;
}
+size_t HWComposer::getLayerCount(int type) const {
+ switch (type) {
+ case HWC_OVERLAY:
+ return mNumOVLayers;
+ case HWC_FRAMEBUFFER:
+ return mNumFBLayers;
+ }
+ return 0;
+}
+
status_t HWComposer::commit() const {
int err = mHwc->set(mHwc, mDpy, mSur, mList);
if (mList) {
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index 8758a80..aa8ebe1 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -64,6 +64,9 @@ public:
size_t getNumLayers() const;
hwc_layer_t* getLayers() const;
+ // updated in preapre()
+ size_t getLayerCount(int type) const;
+
// for debugging
void dump(String8& out, char* scratch, size_t SIZE,
const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const;
@@ -81,6 +84,8 @@ private:
hwc_composer_device_t* mHwc;
hwc_layer_list_t* mList;
size_t mCapacity;
+ mutable size_t mNumOVLayers;
+ mutable size_t mNumFBLayers;
hwc_display_t mDpy;
hwc_surface_t mSur;
cb_context mCBContext;