summaryrefslogtreecommitdiff
path: root/opengl/tests/lib/WindowSurface.cpp
diff options
context:
space:
mode:
authorDominik Laskowski <domlaskowski@google.com>2019-01-25 02:35:50 -0800
committerDominik Laskowski <domlaskowski@google.com>2019-02-02 10:14:22 -0800
commitdcb38bbd32eb96ec46d69658390353a853b3af6d (patch)
tree78b3424dde3c1eac9969482afaff98462dc48221 /opengl/tests/lib/WindowSurface.cpp
parent8a0222e629b82dda35840aa74eeec55bcc16999d (diff)
SF: Plumb physical display IDs to libgui
This CL replaces ISurfaceComposer::{eDisplayIdMain,eDisplayIdHdmi} with the stable 64-bit display IDs generated by SF. Note that the 64-bit IDs fall back to the old values if the HWC API for display identification is not supported. Bug: 74619554 Test: LocalDisplayAdapter and Choreographer receive 64-bit IDs Test: 64-bit IDs fall back to 0 and 1 on HWC 2.2 and below Change-Id: I3c08eff6eb8bb179ecce596ab2820a2aa44c8649
Diffstat (limited to 'opengl/tests/lib/WindowSurface.cpp')
-rw-r--r--opengl/tests/lib/WindowSurface.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/opengl/tests/lib/WindowSurface.cpp b/opengl/tests/lib/WindowSurface.cpp
index b06422a98c..a0bd4e2409 100644
--- a/opengl/tests/lib/WindowSurface.cpp
+++ b/opengl/tests/lib/WindowSurface.cpp
@@ -34,8 +34,12 @@ WindowSurface::WindowSurface() {
}
// Get main display parameters.
- sp<IBinder> mainDpy = SurfaceComposerClient::getBuiltInDisplay(
- ISurfaceComposer::eDisplayIdMain);
+ const auto mainDpy = SurfaceComposerClient::getInternalDisplayToken();
+ if (mainDpy == nullptr) {
+ fprintf(stderr, "ERROR: no display\n");
+ return;
+ }
+
DisplayInfo mainDpyInfo;
err = SurfaceComposerClient::getDisplayInfo(mainDpy, &mainDpyInfo);
if (err != NO_ERROR) {