diff options
author | Mathias Agopian <mathias@google.com> | 2012-08-09 16:29:12 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-08-10 17:32:33 -0700 |
commit | e57f292595bec48f65c8088b00ff6beea01217e9 (patch) | |
tree | 2db8aac9c9056e099ad70d7ce70eb0ac7a8223ae /include/gui | |
parent | ef7b9c7eac036cc1230c64821039d18f8cbd2c1c (diff) | |
download | frameworks_native-e57f292595bec48f65c8088b00ff6beea01217e9.zip frameworks_native-e57f292595bec48f65c8088b00ff6beea01217e9.tar.gz frameworks_native-e57f292595bec48f65c8088b00ff6beea01217e9.tar.bz2 |
make multi-display more real
- displays are represented by a binder on the client side
- c++ clients can now create and modify displays
Change-Id: I203ea5b4beae0819d742ec5171c27568f4e8354b
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/ISurfaceComposer.h | 38 | ||||
-rw-r--r-- | include/gui/SurfaceComposerClient.h | 26 |
2 files changed, 47 insertions, 17 deletions
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h index b2f8889..9ab35b1 100644 --- a/include/gui/ISurfaceComposer.h +++ b/include/gui/ISurfaceComposer.h @@ -48,6 +48,11 @@ public: eSynchronous = 0x01, }; + enum { + eDisplayIdMain = 0, + eDisplayIdHdmi = 1 + }; + /* create connection with surface flinger, requires * ACCESS_SURFACE_FLINGER permission */ @@ -57,6 +62,19 @@ public: */ virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc() = 0; + /* return an IDisplayEventConnection */ + virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0; + + /* create a display with given id. + * requires ACCESS_SURFACE_FLINGER permission. + */ + virtual sp<IBinder> createDisplay() = 0; + + /* get the token for the existing default displays. possible values + * for id are eDisplayIdMain and eDisplayIdHdmi. + */ + virtual sp<IBinder> getBuiltInDisplay(int32_t id) = 0; + /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */ virtual void setTransactionState(const Vector<ComposerState>& state, const Vector<DisplayState>& displays, uint32_t flags) = 0; @@ -66,6 +84,11 @@ public: */ virtual void bootFinished() = 0; + /* verify that an ISurfaceTexture was created by SurfaceFlinger. + */ + virtual bool authenticateSurfaceTexture( + const sp<ISurfaceTexture>& surface) const = 0; + /* Capture the specified screen. requires READ_FRAME_BUFFER permission * This function will fail if there is a secure window on screen. */ @@ -74,13 +97,6 @@ public: uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ) = 0; - /* verify that an ISurfaceTexture was created by SurfaceFlinger. - */ - virtual bool authenticateSurfaceTexture( - const sp<ISurfaceTexture>& surface) const = 0; - - /* return an IDisplayEventConnection */ - virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0; /* triggers screen off and waits for it to complete */ virtual void blank() = 0; @@ -106,13 +122,15 @@ public: BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION, CREATE_CONNECTION, CREATE_GRAPHIC_BUFFER_ALLOC, - GET_DISPLAY_INFO, + CREATE_DISPLAY_EVENT_CONNECTION, + CREATE_DISPLAY, + GET_BUILT_IN_DISPLAY, SET_TRANSACTION_STATE, - CAPTURE_SCREEN, AUTHENTICATE_SURFACE, - CREATE_DISPLAY_EVENT_CONNECTION, + CAPTURE_SCREEN, BLANK, UNBLANK, + GET_DISPLAY_INFO, CONNECT_DISPLAY, }; diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h index b058b8d..5776038 100644 --- a/include/gui/SurfaceComposerClient.h +++ b/include/gui/SurfaceComposerClient.h @@ -59,6 +59,13 @@ public: // Forcibly remove connection before all references have gone away. void dispose(); + // callback when the composer is dies + status_t linkToComposerDeath(const sp<IBinder::DeathRecipient>& recipient, + void* cookie = NULL, uint32_t flags = 0); + + // Get information about a display + static status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info); + // ------------------------------------------------------------------------ // surface creation / destruction @@ -80,13 +87,14 @@ public: uint32_t flags = 0 // usage flags ); + static sp<IBinder> createDisplay(); // ------------------------------------------------------------------------ // Composer parameters // All composer parameters must be changed within a transaction // several surfaces can be updated in one transaction, all changes are // committed at once when the transaction is closed. - // closeGlobalTransaction() usually requires an IPC with the server. + // closeGlobalTransaction() requires an IPC with the server. //! Open a composer transaction on all active SurfaceComposerClients. static void openGlobalTransaction(); @@ -97,12 +105,6 @@ public: //! Set the orientation of the given display static int setOrientation(DisplayID dpy, int orientation, uint32_t flags); - // Get information about a display - static status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info); - - status_t linkToComposerDeath(const sp<IBinder::DeathRecipient>& recipient, - void* cookie = NULL, uint32_t flags = 0); - status_t hide(SurfaceID id); status_t show(SurfaceID id, int32_t layer = -1); status_t setFlags(SurfaceID id, uint32_t flags, uint32_t mask); @@ -116,6 +118,16 @@ public: status_t setLayerStack(SurfaceID id, uint32_t layerStack); status_t destroySurface(SurfaceID sid); + static void setDisplaySurface(const sp<IBinder>& token, + const sp<ISurfaceTexture>& surface); + static void setDisplayLayerStack(const sp<IBinder>& token, + uint32_t layerStack); + static void setDisplayOrientation(const sp<IBinder>& token, + uint32_t orientation); + static void setDisplayViewport(const sp<IBinder>& token, + const Rect& viewport); + static void setDisplayFrame(const sp<IBinder>& token, const Rect& frame); + private: virtual void onFirstRef(); Composer& getComposer(); |