diff options
-rw-r--r-- | include/gui/Surface.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/gui/Surface.h b/include/gui/Surface.h index 4300a0ffff..a48e7e45ab 100644 --- a/include/gui/Surface.h +++ b/include/gui/Surface.h @@ -57,6 +57,10 @@ public: static status_t writeToParcel(const sp<Surface>& surface, Parcel* parcel); static sp<Surface> readFromParcel(const Parcel& data); + bool isValid(const sp<Surface>& surface) const { + return surface != NULL && surface->getIGraphicBufferProducer() != NULL; + } + // FIXME: temporary for source compatibility... sp<IGraphicBufferProducer> getISurfaceTexture() const { return getIGraphicBufferProducer(); |