From b7e930db175c192464cebdeb49eb56cf6dd60114 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 1 Jun 2010 15:12:58 -0700 Subject: split surface management from surface's buffers management Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87 --- include/surfaceflinger/ISurfaceComposer.h | 6 +++- include/surfaceflinger/ISurfaceComposerClient.h | 1 + include/surfaceflinger/Surface.h | 9 +++--- include/surfaceflinger/SurfaceComposerClient.h | 38 ++++++++++++------------- 4 files changed, 28 insertions(+), 26 deletions(-) (limited to 'include/surfaceflinger') diff --git a/include/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h index 3271cfd475..dd44aa5afa 100644 --- a/include/surfaceflinger/ISurfaceComposer.h +++ b/include/surfaceflinger/ISurfaceComposer.h @@ -85,9 +85,12 @@ public: /* create connection with surface flinger, requires * ACCESS_SURFACE_FLINGER permission */ - virtual sp createConnection() = 0; + /* create a client connection with surface flinger + */ + virtual sp createClientConnection() = 0; + /* retrieve the control block */ virtual sp getCblk() const = 0; @@ -123,6 +126,7 @@ public: // Java by ActivityManagerService. BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION, CREATE_CONNECTION, + CREATE_CLIENT_CONNECTION, GET_CBLK, OPEN_GLOBAL_TRANSACTION, CLOSE_GLOBAL_TRANSACTION, diff --git a/include/surfaceflinger/ISurfaceComposerClient.h b/include/surfaceflinger/ISurfaceComposerClient.h index b2a4766bc4..a1e9e04884 100644 --- a/include/surfaceflinger/ISurfaceComposerClient.h +++ b/include/surfaceflinger/ISurfaceComposerClient.h @@ -58,6 +58,7 @@ public: }; virtual sp getControlBlock() const = 0; + virtual ssize_t getTokenForSurface(const sp& sur) const = 0; /* * Requires ACCESS_SURFACE_FLINGER permission diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 295797066f..67dc693429 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -229,7 +229,6 @@ private: */ void init(); status_t validate() const; - status_t initCheck() const; sp getISurface() const; inline const GraphicBufferMapper& getBufferMapper() const { return mBufferMapper; } @@ -264,15 +263,15 @@ private: }; // constants - sp mClient; + GraphicBufferMapper& mBufferMapper; + SurfaceClient& mClient; + SharedBufferClient* mSharedBufferClient; + status_t mInitCheck; sp mSurface; SurfaceID mToken; uint32_t mIdentity; PixelFormat mFormat; uint32_t mFlags; - GraphicBufferMapper& mBufferMapper; - SharedBufferClient* mSharedBufferClient; - status_t mInitCheck; // protected by mSurfaceLock Rect mSwapRectangle; diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h index 8e28a815bf..8773d7133b 100644 --- a/include/surfaceflinger/SurfaceComposerClient.h +++ b/include/surfaceflinger/SurfaceComposerClient.h @@ -22,8 +22,9 @@ #include -#include #include +#include +#include #include #include @@ -39,6 +40,22 @@ class Region; class SharedClient; class ISurfaceComposer; class DisplayInfo; +class surface_flinger_cblk_t; + +// --------------------------------------------------------------------------- + +class ComposerService : public Singleton +{ + // these are constants + sp mComposerService; + sp mServerCblkMemory; + surface_flinger_cblk_t volatile* mServerCblk; + ComposerService(); + friend class Singleton; +public: + static sp getComposerService(); + static surface_flinger_cblk_t const volatile * getControlBlock(); +}; // --------------------------------------------------------------------------- @@ -152,25 +169,6 @@ private: sp mClient; }; -// --------------------------------------------------------------------------- - -class SurfaceClient : public RefBase -{ - // all these attributes are constants - status_t mStatus; - SharedClient* mControl; - sp mControlMemory; - sp mConnection; - sp mComposerService; - void init(const sp& conn); -public: - explicit SurfaceClient(const sp& conn); - explicit SurfaceClient(const sp& client); - status_t initCheck() const; - SharedClient* getSharedClient() const; - void signalServer() const; -}; - // --------------------------------------------------------------------------- }; // namespace android -- cgit v1.2.3-59-g8ed1b