diff options
author | Dan Stoza <stoza@google.com> | 2015-06-08 09:32:50 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2015-06-09 11:28:37 -0700 |
commit | 53a2e97a78a2a567a17b44feaebbe57a28aa8a56 (patch) | |
tree | 9c750b774358623f46c6283846e14281ee6195bd /services/surfaceflinger | |
parent | b169b49aecdbf3424f334ac2b22c36a2988a8338 (diff) | |
download | frameworks_native-53a2e97a78a2a567a17b44feaebbe57a28aa8a56.zip frameworks_native-53a2e97a78a2a567a17b44feaebbe57a28aa8a56.tar.gz frameworks_native-53a2e97a78a2a567a17b44feaebbe57a28aa8a56.tar.bz2 |
libgui/SurfaceFlinger: Add getConsumerName
Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.
Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
(cherry picked from commit c6f30bdee1f634eb90d68cb76efe935b6535a1e8)
Diffstat (limited to 'services/surfaceflinger')
4 files changed, 10 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index ee8d41c..ba4c198 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -535,6 +535,10 @@ status_t VirtualDisplaySurface::setGenerationNumber(uint32_t /* generation */) { return INVALID_OPERATION; } +String8 VirtualDisplaySurface::getConsumerName() const { + return String8("VirtualDisplaySurface"); +} + void VirtualDisplaySurface::updateQueueBufferOutput( const QueueBufferOutput& qbo) { uint32_t w, h, transformHint, numPendingBuffers; diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h index ff02290..6298751 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h @@ -117,6 +117,7 @@ private: PixelFormat format, uint32_t usage); virtual status_t allowAllocation(bool allow); virtual status_t setGenerationNumber(uint32_t generationNumber); + virtual String8 getConsumerName() const override; // // Utility methods diff --git a/services/surfaceflinger/MonitoredProducer.cpp b/services/surfaceflinger/MonitoredProducer.cpp index 6f25bf5..fb7af97 100644 --- a/services/surfaceflinger/MonitoredProducer.cpp +++ b/services/surfaceflinger/MonitoredProducer.cpp @@ -118,6 +118,10 @@ status_t MonitoredProducer::setGenerationNumber(uint32_t generationNumber) { return mProducer->setGenerationNumber(generationNumber); } +String8 MonitoredProducer::getConsumerName() const { + return mProducer->getConsumerName(); +} + IBinder* MonitoredProducer::onAsBinder() { return IInterface::asBinder(mProducer).get(); } diff --git a/services/surfaceflinger/MonitoredProducer.h b/services/surfaceflinger/MonitoredProducer.h index ff691d8..da95766 100644 --- a/services/surfaceflinger/MonitoredProducer.h +++ b/services/surfaceflinger/MonitoredProducer.h @@ -55,6 +55,7 @@ public: PixelFormat format, uint32_t usage); virtual status_t allowAllocation(bool allow); virtual status_t setGenerationNumber(uint32_t generationNumber); + virtual String8 getConsumerName() const override; virtual IBinder* onAsBinder(); private: |