diff options
| author | Mathias Agopian <mathias@google.com> | 2009-08-19 17:46:26 -0700 |
|---|---|---|
| committer | Mathias Agopian <mathias@google.com> | 2009-08-19 17:46:26 -0700 |
| commit | 18b6b49ea5235fb6c0802db9a0cc2c6dd20646cb (patch) | |
| tree | 99d8c9f592a961c1af7f583792f4178bce2cc89f /libs/surfaceflinger | |
| parent | b2f8450db8dfbc05724624f93d9ec5e65f0b7e54 (diff) | |
| download | frameworks_base-18b6b49ea5235fb6c0802db9a0cc2c6dd20646cb.zip frameworks_base-18b6b49ea5235fb6c0802db9a0cc2c6dd20646cb.tar.gz frameworks_base-18b6b49ea5235fb6c0802db9a0cc2c6dd20646cb.tar.bz2 | |
fix a bug that caused the PixelFormat viewed by Surface to be wrong.
what happened is that the efective pixel format is calculated by SF but Surface nevew had access to it directly.
in particular this caused query(FORMAT) to return the requested format instead of the effective format.
Diffstat (limited to 'libs/surfaceflinger')
| -rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 8 | ||||
| -rw-r--r-- | libs/surfaceflinger/LayerBase.h | 5 | ||||
| -rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.cpp | 18 | ||||
| -rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.h | 4 |
4 files changed, 17 insertions, 18 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index 419574c..fd54e35 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -730,14 +730,6 @@ sp<LayerBaseClient> LayerBaseClient::Surface::getOwner() const { return owner; } - -void LayerBaseClient::Surface::getSurfaceData( - ISurfaceFlingerClient::surface_data_t* params) const -{ - params->token = mToken; - params->identity = mIdentity; -} - status_t LayerBaseClient::Surface::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { diff --git a/libs/surfaceflinger/LayerBase.h b/libs/surfaceflinger/LayerBase.h index 65bf55b..7791941 100644 --- a/libs/surfaceflinger/LayerBase.h +++ b/libs/surfaceflinger/LayerBase.h @@ -321,10 +321,9 @@ public: class Surface : public BnSurface { public: + int32_t getToken() const { return mToken; } + int32_t getIdentity() const { return mIdentity; } - virtual void getSurfaceData( - ISurfaceFlingerClient::surface_data_t* params) const; - protected: Surface(const sp<SurfaceFlinger>& flinger, SurfaceID id, int identity, diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp index 102899c..3824024 100644 --- a/libs/surfaceflinger/SurfaceFlinger.cpp +++ b/libs/surfaceflinger/SurfaceFlinger.cpp @@ -1239,9 +1239,11 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid, switch (flags & eFXSurfaceMask) { case eFXSurfaceNormal: if (UNLIKELY(flags & ePushBuffers)) { - layer = createPushBuffersSurfaceLocked(client, d, id, w, h, flags); + layer = createPushBuffersSurfaceLocked(client, d, id, + w, h, flags); } else { - layer = createNormalSurfaceLocked(client, d, id, w, h, format, flags); + layer = createNormalSurfaceLocked(client, d, id, + w, h, flags, format); } break; case eFXSurfaceBlur: @@ -1255,8 +1257,13 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid, if (layer != 0) { setTransactionFlags(eTransactionNeeded); surfaceHandle = layer->getSurface(); - if (surfaceHandle != 0) - surfaceHandle->getSurfaceData(params); + if (surfaceHandle != 0) { + params->token = surfaceHandle->getToken(); + params->identity = surfaceHandle->getIdentity(); + params->width = w; + params->height = h; + params->format = format; + } } return surfaceHandle; @@ -1264,7 +1271,8 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid, sp<LayerBaseClient> SurfaceFlinger::createNormalSurfaceLocked( const sp<Client>& client, DisplayID display, - int32_t id, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags) + int32_t id, uint32_t w, uint32_t h, uint32_t flags, + PixelFormat& format) { // initialize the surfaces switch (format) { // TODO: take h/w into account diff --git a/libs/surfaceflinger/SurfaceFlinger.h b/libs/surfaceflinger/SurfaceFlinger.h index 2569a0f..56ea97a 100644 --- a/libs/surfaceflinger/SurfaceFlinger.h +++ b/libs/surfaceflinger/SurfaceFlinger.h @@ -195,8 +195,8 @@ private: sp<LayerBaseClient> createNormalSurfaceLocked( const sp<Client>& client, DisplayID display, - int32_t id, uint32_t w, uint32_t h, - PixelFormat format, uint32_t flags); + int32_t id, uint32_t w, uint32_t h, uint32_t flags, + PixelFormat& format); sp<LayerBaseClient> createBlurSurfaceLocked( const sp<Client>& client, DisplayID display, |
