diff options
Diffstat (limited to 'include/surfaceflinger')
-rw-r--r-- | include/surfaceflinger/Surface.h | 3 | ||||
-rw-r--r-- | include/surfaceflinger/SurfaceComposerClient.h | 43 |
2 files changed, 27 insertions, 19 deletions
diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index e561fb9..33269cb 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -44,6 +44,7 @@ class Surface; class SurfaceComposerClient; class SharedClient; class SharedBufferClient; +class SurfaceClient; // --------------------------------------------------------------------------- @@ -263,7 +264,7 @@ private: }; // constants - sp<SurfaceComposerClient> mClient; + sp<SurfaceClient> mClient; sp<ISurface> mSurface; SurfaceID mToken; uint32_t mIdentity; diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h index 8396038..102aebc 100644 --- a/include/surfaceflinger/SurfaceComposerClient.h +++ b/include/surfaceflinger/SurfaceComposerClient.h @@ -40,7 +40,9 @@ class SharedClient; class ISurfaceComposer; class DisplayInfo; -class SurfaceComposerClient : virtual public RefBase +// --------------------------------------------------------------------------- + +class SurfaceComposerClient : public RefBase { public: SurfaceComposerClient(); @@ -52,10 +54,6 @@ public: // Return the connection of this client sp<IBinder> connection() const; - // Retrieve a client for an existing connection. - static sp<SurfaceComposerClient> - clientForConnection(const sp<IBinder>& conn); - // Forcibly remove connection before all references have gone away. void dispose(); @@ -135,36 +133,45 @@ public: status_t setMatrix(SurfaceID id, float dsdx, float dtdx, float dsdy, float dtdy); status_t setPosition(SurfaceID id, int32_t x, int32_t y); status_t setSize(SurfaceID id, uint32_t w, uint32_t h); - void signalServer(); status_t destroySurface(SurfaceID sid); - SharedClient* getSharedClient() const; - private: - SurfaceComposerClient(const sp<ISurfaceComposer>& sm, - const sp<IBinder>& conn); - - void init(const sp<ISurfaceComposer>& sm, - const sp<ISurfaceFlingerClient>& conn); - + virtual void onFirstRef(); inline layer_state_t* get_state_l(SurfaceID id); layer_state_t* lockLayerState(SurfaceID id); inline void unlockLayerState(); mutable Mutex mLock; - layer_state_t* mPrebuiltLayerState; SortedVector<layer_state_t> mStates; int32_t mTransactionOpen; + layer_state_t* mPrebuiltLayerState; // these don't need to be protected because they never change // after assignment status_t mStatus; - SharedClient* mControl; - sp<IMemoryHeap> mControlMemory; sp<ISurfaceFlingerClient> mClient; - sp<ISurfaceComposer> mSignalServer; }; +// --------------------------------------------------------------------------- + +class SurfaceClient : public RefBase +{ + // all these attributes are constants + status_t mStatus; + SharedClient* mControl; + sp<IMemoryHeap> mControlMemory; + sp<IBinder> mConnection; + sp<ISurfaceComposer> mSignalServer; + 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 |