diff options
| -rw-r--r-- | include/gui/SurfaceComposerClient.h | 1 | ||||
| -rw-r--r-- | libs/binder/Parcel.cpp | 45 | ||||
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 4 |
3 files changed, 49 insertions, 1 deletions
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h index 23655c7ec0..6bf5b47f99 100644 --- a/include/gui/SurfaceComposerClient.h +++ b/include/gui/SurfaceComposerClient.h @@ -170,6 +170,7 @@ private: public: ScreenshotClient(); + ~ScreenshotClient(); // frees the previous screenshot and capture a new one status_t update(const sp<IBinder>& display); diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 4c15913a7f..8f7f7e76d5 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -627,11 +627,27 @@ status_t Parcel::writeFloat(float val) return writeAligned(val); } +#if defined(__mips__) && defined(__mips_hard_float) + +status_t Parcel::writeDouble(double val) +{ + union { + double d; + unsigned long long ll; + } u; + u.d = val; + return writeAligned(u.ll); +} + +#else + status_t Parcel::writeDouble(double val) { return writeAligned(val); } +#endif + status_t Parcel::writeIntPtr(intptr_t val) { return writeAligned(val); @@ -962,17 +978,44 @@ float Parcel::readFloat() const return readAligned<float>(); } +#if defined(__mips__) && defined(__mips_hard_float) + status_t Parcel::readDouble(double *pArg) const { - return readAligned(pArg); + union { + double d; + unsigned long long ll; + } u; + status_t status; + status = readAligned(&u.ll); + *pArg = u.d; + return status; } +double Parcel::readDouble() const +{ + union { + double d; + unsigned long long ll; + } u; + u.ll = readAligned<unsigned long long>(); + return u.d; +} + +#else + +status_t Parcel::readDouble(double *pArg) const +{ + return readAligned(pArg); +} double Parcel::readDouble() const { return readAligned<double>(); } +#endif + status_t Parcel::readIntPtr(intptr_t *pArg) const { return readAligned(pArg); diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index ec46fce403..f345df88bc 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -627,6 +627,10 @@ ScreenshotClient::ScreenshotClient() memset(&mBuffer, 0, sizeof(mBuffer)); } +ScreenshotClient::~ScreenshotClient() { + ScreenshotClient::release(); +} + sp<CpuConsumer> ScreenshotClient::getCpuConsumer() const { if (mCpuConsumer == NULL) { mCpuConsumer = new CpuConsumer(1); |