diff options
author | Raj Kamal <rkamal@codeaurora.org> | 2015-06-23 12:55:15 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:22:25 -0600 |
commit | 20f9ced88123b0daca067ca55f1dc96c8b7b02e3 (patch) | |
tree | 774e7b179ead74ef6b9fb8f7566c75c02c466b60 /services/surfaceflinger/DisplayHardware | |
parent | 8eaa19460dcaaead5987332580ac338e20af456b (diff) | |
download | frameworks_native-20f9ced88123b0daca067ca55f1dc96c8b7b02e3.zip frameworks_native-20f9ced88123b0daca067ca55f1dc96c8b7b02e3.tar.gz frameworks_native-20f9ced88123b0daca067ca55f1dc96c8b7b02e3.tar.bz2 |
SurfaceFlinger: Add support for DisplayUtils
Add DisplayUtils class which uses the custom implementations
of ExLayer, ExSurfaceFlinger, ExHWComposer,
and ExVirtualDisplaySurface classes if needed
Change-Id: Ibdd8da5d3d0d602f42b76a15d0994c6aa98bee3f
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
3 files changed, 15 insertions, 3 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index 814f6a3..d262f84 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -74,7 +74,7 @@ public: const sp<SurfaceFlinger>& flinger, EventHandler& handler); - ~HWComposer(); + virtual ~HWComposer(); status_t initCheck() const; @@ -304,6 +304,11 @@ public: // for debugging ---------------------------------------------------------- void dump(String8& out) const; + /* ------------------------------------------------------------------------ + * Extensions + */ + virtual inline bool isVDSEnabled() const { return true; }; + private: void loadHwcModule(); int loadFbHalModule(); diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index ba4c198..1e4f907 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -152,7 +152,7 @@ status_t VirtualDisplaySurface::prepareFrame(CompositionType compositionType) { // format/usage and get a new buffer when the GLES driver calls // dequeueBuffer(). mOutputFormat = mDefaultOutputFormat; - mOutputUsage = GRALLOC_USAGE_HW_COMPOSER; + setOutputUsage(GRALLOC_USAGE_HW_COMPOSER); refreshOutputBuffer(); } @@ -377,7 +377,7 @@ status_t VirtualDisplaySurface::dequeueBuffer(int* pslot, sp<Fence>* fence, bool mSinkBufferWidth, mSinkBufferHeight, buf->getPixelFormat(), buf->getUsage()); mOutputFormat = format; - mOutputUsage = usage; + setOutputUsage(usage); result = refreshOutputBuffer(); if (result < 0) return result; @@ -616,6 +616,10 @@ const char* VirtualDisplaySurface::dbgSourceStr(Source s) { } } +void VirtualDisplaySurface::setOutputUsage(uint32_t usage) { + mOutputUsage = usage; +} + // --------------------------------------------------------------------------- } // namespace android // --------------------------------------------------------------------------- diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h index 6298751..8b153d3 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h @@ -72,6 +72,8 @@ class VirtualDisplaySurface : public DisplaySurface, public BnGraphicBufferProducer, private ConsumerBase { public: + friend class ExVirtualDisplaySurface; + VirtualDisplaySurface(HWComposer& hwc, int32_t dispId, const sp<IGraphicBufferProducer>& sink, const sp<IGraphicBufferProducer>& bqProducer, @@ -118,6 +120,7 @@ private: virtual status_t allowAllocation(bool allow); virtual status_t setGenerationNumber(uint32_t generationNumber); virtual String8 getConsumerName() const override; + virtual void setOutputUsage(uint32_t flag); // // Utility methods |