diff options
author | Dominik Laskowski <domlaskowski@google.com> | 2019-01-25 02:56:41 -0800 |
---|---|---|
committer | Dominik Laskowski <domlaskowski@google.com> | 2019-02-04 10:06:15 -0800 |
commit | 3316a0a08e79739b0508087232efcb3f2803dafe (patch) | |
tree | 90ae4e9f996c661ed2ec25b4ba2fa9075a877b8a /cmds/bootanimation/BootAnimation.cpp | |
parent | 1ba86936a955ef4e3206d8e862ce4f1b4550c2e5 (diff) |
Generalize physical display management
This CL enables the framework to manage an arbitrary number of physical
displays. It also surfaces physical display IDs, which are stable across
reboots and encode (model, port) information that will be propagated
further up in a follow-up CL.
Bug: 116025192
Test: Boot with more than two displays
Test: Hotplug works with any number of displays
Test: Verify stable display IDs with "dumpsys display"
Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 5dcb392b002d..46917e4f6062 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -252,10 +252,12 @@ status_t BootAnimation::initTexture(FileMap* map, int* width, int* height) status_t BootAnimation::readyToRun() { mAssets.addDefaultAssets(); - sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay( - ISurfaceComposer::eDisplayIdMain)); + mDisplayToken = SurfaceComposerClient::getInternalDisplayToken(); + if (mDisplayToken == nullptr) + return -1; + DisplayInfo dinfo; - status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &dinfo); + status_t status = SurfaceComposerClient::getDisplayInfo(mDisplayToken, &dinfo); if (status) return -1; @@ -1014,16 +1016,13 @@ void BootAnimation::handleViewport(nsecs_t timestep) { // At the end of the animation, we switch to the viewport that DisplayManager will apply // later. This changes the coordinate system, and means we must move the surface up by // the inset amount. - sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay( - ISurfaceComposer::eDisplayIdMain)); - Rect layerStackRect(0, 0, mWidth, mHeight - mTargetInset); Rect displayRect(0, mTargetInset, mWidth, mHeight); SurfaceComposerClient::Transaction t; t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset) .setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight)); - t.setDisplayProjection(dtoken, 0 /* orientation */, layerStackRect, displayRect); + t.setDisplayProjection(mDisplayToken, 0 /* orientation */, layerStackRect, displayRect); t.apply(); mTargetInset = mCurrentInset = 0; |