summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp16
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0e5d602..2df279a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2381,9 +2381,21 @@ void SurfaceFlinger::dumpAllLocked(
}
const Vector< sp<Layer> >&
-SurfaceFlinger::getLayerSortedByZForHwcDisplay(int disp) {
+SurfaceFlinger::getLayerSortedByZForHwcDisplay(int id) {
// Note: mStateLock is held here
- return getDisplayDevice( getBuiltInDisplay(disp) )->getVisibleLayersSortedByZ();
+ wp<IBinder> dpy;
+ for (size_t i=0 ; i<mDisplays.size() ; i++) {
+ if (mDisplays.valueAt(i)->getHwcDisplayId() == id) {
+ dpy = mDisplays.keyAt(i);
+ break;
+ }
+ }
+ if (dpy == NULL) {
+ ALOGE("getLayerSortedByZForHwcDisplay: invalid hwc display id %d", id);
+ // Just use the primary display so we have something to return
+ dpy = getBuiltInDisplay(DisplayDevice::DISPLAY_PRIMARY);
+ }
+ return getDisplayDevice(dpy)->getVisibleLayersSortedByZ();
}
bool SurfaceFlinger::startDdmConnection()
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 1017560..f0e6deb 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -122,7 +122,7 @@ public:
// for debugging only
// TODO: this should be made accessible only to HWComposer
- const Vector< sp<Layer> >& getLayerSortedByZForHwcDisplay(int disp);
+ const Vector< sp<Layer> >& getLayerSortedByZForHwcDisplay(int id);
private:
friend class Client;