diff options
author | Mathias Agopian <mathias@google.com> | 2010-06-01 15:12:58 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-06-04 18:57:41 -0700 |
commit | 7623da435e45c7c03ef6a00a43675deb6645f070 (patch) | |
tree | b789cdc5e60ccc4474bd319b1dbb4e1a7e3f3858 /include/surfaceflinger | |
parent | 593c05ce7bcf7b6d94bd8c50da2b818cf05116b1 (diff) | |
download | frameworks_base-7623da435e45c7c03ef6a00a43675deb6645f070.zip frameworks_base-7623da435e45c7c03ef6a00a43675deb6645f070.tar.gz frameworks_base-7623da435e45c7c03ef6a00a43675deb6645f070.tar.bz2 |
split surface management from surface's buffers management
Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
Diffstat (limited to 'include/surfaceflinger')
-rw-r--r-- | include/surfaceflinger/ISurfaceComposer.h | 6 | ||||
-rw-r--r-- | include/surfaceflinger/ISurfaceComposerClient.h | 1 | ||||
-rw-r--r-- | include/surfaceflinger/Surface.h | 9 | ||||
-rw-r--r-- | include/surfaceflinger/SurfaceComposerClient.h | 38 |
4 files changed, 28 insertions, 26 deletions
diff --git a/include/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h index 3271cfd..dd44aa5 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<ISurfaceComposerClient> createConnection() = 0; + /* create a client connection with surface flinger + */ + virtual sp<ISurfaceComposerClient> createClientConnection() = 0; + /* retrieve the control block */ virtual sp<IMemoryHeap> 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 b2a4766..a1e9e04 100644 --- a/include/surfaceflinger/ISurfaceComposerClient.h +++ b/include/surfaceflinger/ISurfaceComposerClient.h @@ -58,6 +58,7 @@ public: }; virtual sp<IMemoryHeap> getControlBlock() const = 0; + virtual ssize_t getTokenForSurface(const sp<ISurface>& sur) const = 0; /* * Requires ACCESS_SURFACE_FLINGER permission diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 2957970..67dc693 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<ISurface> getISurface() const; inline const GraphicBufferMapper& getBufferMapper() const { return mBufferMapper; } @@ -264,15 +263,15 @@ private: }; // constants - sp<SurfaceClient> mClient; + GraphicBufferMapper& mBufferMapper; + SurfaceClient& mClient; + SharedBufferClient* mSharedBufferClient; + status_t mInitCheck; sp<ISurface> 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 8e28a81..8773d71 100644 --- a/include/surfaceflinger/SurfaceComposerClient.h +++ b/include/surfaceflinger/SurfaceComposerClient.h @@ -22,8 +22,9 @@ #include <binder/IBinder.h> -#include <utils/SortedVector.h> #include <utils/RefBase.h> +#include <utils/Singleton.h> +#include <utils/SortedVector.h> #include <utils/threads.h> #include <ui/PixelFormat.h> @@ -39,6 +40,22 @@ class Region; class SharedClient; class ISurfaceComposer; class DisplayInfo; +class surface_flinger_cblk_t; + +// --------------------------------------------------------------------------- + +class ComposerService : public Singleton<ComposerService> +{ + // these are constants + sp<ISurfaceComposer> mComposerService; + sp<IMemoryHeap> mServerCblkMemory; + surface_flinger_cblk_t volatile* mServerCblk; + ComposerService(); + friend class Singleton<ComposerService>; +public: + static sp<ISurfaceComposer> getComposerService(); + static surface_flinger_cblk_t const volatile * getControlBlock(); +}; // --------------------------------------------------------------------------- @@ -153,25 +170,6 @@ private: }; // --------------------------------------------------------------------------- - -class SurfaceClient : public RefBase -{ - // all these attributes are constants - status_t mStatus; - SharedClient* mControl; - sp<IMemoryHeap> mControlMemory; - sp<IBinder> mConnection; - sp<ISurfaceComposer> mComposerService; - void init(const sp<IBinder>& conn); -public: - explicit SurfaceClient(const sp<IBinder>& conn); - explicit SurfaceClient(const sp<SurfaceComposerClient>& client); - status_t initCheck() const; - SharedClient* getSharedClient() const; - void signalServer() const; -}; - -// --------------------------------------------------------------------------- }; // namespace android #endif // ANDROID_SF_SURFACE_COMPOSER_CLIENT_H |