Loading libs/gui/SurfaceComposerClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ status_t SurfaceComposerClient::Transaction::readFromParcel(const Parcel* parcel } for (size_t j = 0; j < numSurfaces; j++) { sp<SurfaceControl> surface; surface = SurfaceControl::readFromParcel(parcel); SAFE_PARCEL(SurfaceControl::readFromParcel, *parcel, &surface); listenerCallbacks[listener].surfaceControls.insert(surface); } } Loading Loading @@ -507,7 +507,7 @@ status_t SurfaceComposerClient::Transaction::writeToParcel(Parcel* parcel) const } parcel->writeUint32(static_cast<uint32_t>(callbackInfo.surfaceControls.size())); for (auto surfaceControl : callbackInfo.surfaceControls) { surfaceControl->writeToParcel(parcel); SAFE_PARCEL(surfaceControl->writeToParcel, *parcel); } } Loading libs/gui/SurfaceControl.cpp +21 −28 Original line number Diff line number Diff line Loading @@ -169,42 +169,35 @@ void SurfaceControl::setTransformHint(uint32_t hint) { mTransformHint = hint; } void SurfaceControl::writeToParcel(Parcel* parcel) { parcel->writeStrongBinder(ISurfaceComposerClient::asBinder(mClient->getClient())); parcel->writeStrongBinder(mHandle); parcel->writeStrongBinder(IGraphicBufferProducer::asBinder(mGraphicBufferProducer)); parcel->writeUint32(mTransformHint); status_t SurfaceControl::writeToParcel(Parcel& parcel) { SAFE_PARCEL(parcel.writeStrongBinder, ISurfaceComposerClient::asBinder(mClient->getClient())); SAFE_PARCEL(parcel.writeStrongBinder, mHandle); SAFE_PARCEL(parcel.writeStrongBinder, IGraphicBufferProducer::asBinder(mGraphicBufferProducer)); SAFE_PARCEL(parcel.writeUint32, mTransformHint); return NO_ERROR; } sp<SurfaceControl> SurfaceControl::readFromParcel(const Parcel* parcel) { bool invalidParcel = false; status_t status; status_t SurfaceControl::readFromParcel(const Parcel& parcel, sp<SurfaceControl>* outSurfaceControl) { sp<IBinder> client; if ((status = parcel->readStrongBinder(&client)) != OK) { ALOGE("Failed to read client: %s", statusToString(status).c_str()); invalidParcel = true; } sp<IBinder> handle; if ((status = parcel->readStrongBinder(&handle)) != OK) { ALOGE("Failed to read handle: %s", statusToString(status).c_str()); invalidParcel = true; } sp<IBinder> gbp; if ((status = parcel->readNullableStrongBinder(&gbp)) != OK) { ALOGE("Failed to read gbp: %s", statusToString(status).c_str()); invalidParcel = true; } uint32_t transformHint = parcel->readUint32(); uint32_t transformHint; SAFE_PARCEL(parcel.readStrongBinder, &client); SAFE_PARCEL(parcel.readStrongBinder, &handle); SAFE_PARCEL(parcel.readNullableStrongBinder, &gbp); SAFE_PARCEL(parcel.readUint32, &transformHint); if (invalidParcel) { return nullptr; } // We aren't the original owner of the surface. return new SurfaceControl(new SurfaceComposerClient( *outSurfaceControl = new SurfaceControl(new SurfaceComposerClient( interface_cast<ISurfaceComposerClient>(client)), handle.get(), interface_cast<IGraphicBufferProducer>(gbp), transformHint); return NO_ERROR; } // ---------------------------------------------------------------------------- Loading libs/gui/include/gui/SurfaceControl.h +2 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,8 @@ class SurfaceComposerClient; class SurfaceControl : public RefBase { public: static sp<SurfaceControl> readFromParcel(const Parcel* parcel); void writeToParcel(Parcel* parcel); static status_t readFromParcel(const Parcel& parcel, sp<SurfaceControl>* outSurfaceControl); status_t writeToParcel(Parcel& parcel); static bool isValid(const sp<SurfaceControl>& surface) { return (surface != nullptr) && surface->isValid(); Loading Loading
libs/gui/SurfaceComposerClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ status_t SurfaceComposerClient::Transaction::readFromParcel(const Parcel* parcel } for (size_t j = 0; j < numSurfaces; j++) { sp<SurfaceControl> surface; surface = SurfaceControl::readFromParcel(parcel); SAFE_PARCEL(SurfaceControl::readFromParcel, *parcel, &surface); listenerCallbacks[listener].surfaceControls.insert(surface); } } Loading Loading @@ -507,7 +507,7 @@ status_t SurfaceComposerClient::Transaction::writeToParcel(Parcel* parcel) const } parcel->writeUint32(static_cast<uint32_t>(callbackInfo.surfaceControls.size())); for (auto surfaceControl : callbackInfo.surfaceControls) { surfaceControl->writeToParcel(parcel); SAFE_PARCEL(surfaceControl->writeToParcel, *parcel); } } Loading
libs/gui/SurfaceControl.cpp +21 −28 Original line number Diff line number Diff line Loading @@ -169,42 +169,35 @@ void SurfaceControl::setTransformHint(uint32_t hint) { mTransformHint = hint; } void SurfaceControl::writeToParcel(Parcel* parcel) { parcel->writeStrongBinder(ISurfaceComposerClient::asBinder(mClient->getClient())); parcel->writeStrongBinder(mHandle); parcel->writeStrongBinder(IGraphicBufferProducer::asBinder(mGraphicBufferProducer)); parcel->writeUint32(mTransformHint); status_t SurfaceControl::writeToParcel(Parcel& parcel) { SAFE_PARCEL(parcel.writeStrongBinder, ISurfaceComposerClient::asBinder(mClient->getClient())); SAFE_PARCEL(parcel.writeStrongBinder, mHandle); SAFE_PARCEL(parcel.writeStrongBinder, IGraphicBufferProducer::asBinder(mGraphicBufferProducer)); SAFE_PARCEL(parcel.writeUint32, mTransformHint); return NO_ERROR; } sp<SurfaceControl> SurfaceControl::readFromParcel(const Parcel* parcel) { bool invalidParcel = false; status_t status; status_t SurfaceControl::readFromParcel(const Parcel& parcel, sp<SurfaceControl>* outSurfaceControl) { sp<IBinder> client; if ((status = parcel->readStrongBinder(&client)) != OK) { ALOGE("Failed to read client: %s", statusToString(status).c_str()); invalidParcel = true; } sp<IBinder> handle; if ((status = parcel->readStrongBinder(&handle)) != OK) { ALOGE("Failed to read handle: %s", statusToString(status).c_str()); invalidParcel = true; } sp<IBinder> gbp; if ((status = parcel->readNullableStrongBinder(&gbp)) != OK) { ALOGE("Failed to read gbp: %s", statusToString(status).c_str()); invalidParcel = true; } uint32_t transformHint = parcel->readUint32(); uint32_t transformHint; SAFE_PARCEL(parcel.readStrongBinder, &client); SAFE_PARCEL(parcel.readStrongBinder, &handle); SAFE_PARCEL(parcel.readNullableStrongBinder, &gbp); SAFE_PARCEL(parcel.readUint32, &transformHint); if (invalidParcel) { return nullptr; } // We aren't the original owner of the surface. return new SurfaceControl(new SurfaceComposerClient( *outSurfaceControl = new SurfaceControl(new SurfaceComposerClient( interface_cast<ISurfaceComposerClient>(client)), handle.get(), interface_cast<IGraphicBufferProducer>(gbp), transformHint); return NO_ERROR; } // ---------------------------------------------------------------------------- Loading
libs/gui/include/gui/SurfaceControl.h +2 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,8 @@ class SurfaceComposerClient; class SurfaceControl : public RefBase { public: static sp<SurfaceControl> readFromParcel(const Parcel* parcel); void writeToParcel(Parcel* parcel); static status_t readFromParcel(const Parcel& parcel, sp<SurfaceControl>* outSurfaceControl); status_t writeToParcel(Parcel& parcel); static bool isValid(const sp<SurfaceControl>& surface) { return (surface != nullptr) && surface->isValid(); Loading