diff options
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.h')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index b3baadd..2003d6e 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -56,6 +56,8 @@ #include "DisplayHardware/HWComposer.h" #include "Effects/Daltonizer.h" +#include "FrameRateHelper.h" + namespace android { // --------------------------------------------------------------------------- @@ -66,6 +68,7 @@ class EventThread; class IGraphicBufferAlloc; class Layer; class LayerDim; +class LayerBlur; class Surface; class RenderEngine; class EventControlThread; @@ -84,6 +87,10 @@ class SurfaceFlinger : public BnSurfaceComposer, private HWComposer::EventHandler { public: +#ifdef QTI_BSP + friend class ExSurfaceFlinger; +#endif + static char const* getServiceName() ANDROID_API { return "SurfaceFlinger"; } @@ -138,7 +145,12 @@ private: friend class Client; friend class DisplayEventConnection; friend class Layer; + friend class LayerDim; +#ifdef QTI_BSP + friend class ExLayer; +#endif friend class MonitoredProducer; + friend class LayerBlur; // This value is specified in number of frames. Log frame stats at most // every half hour. @@ -207,7 +219,8 @@ private: const sp<IGraphicBufferProducer>& producer, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, - bool useIdentityTransform, ISurfaceComposer::Rotation rotation); + bool useIdentityTransform, ISurfaceComposer::Rotation rotation, + bool isCpuConsumer); virtual status_t getDisplayStats(const sp<IBinder>& display, DisplayStatInfo* stats); virtual status_t getDisplayConfigs(const sp<IBinder>& display, @@ -235,6 +248,43 @@ private: virtual void onHotplugReceived(int disp, bool connected); /* ------------------------------------------------------------------------ + * Extensions + */ + virtual void updateExtendedMode() { } + + virtual void getIndexLOI(size_t /*dpy*/, + const LayerVector& /*currentLayers*/, + bool& /*bIgnoreLayers*/, + int& /*indexLOI*/) { } + + virtual bool updateLayerVisibleNonTransparentRegion( + const int& dpy, const sp<Layer>& layer, + bool& bIgnoreLayers, int& indexLOI, + uint32_t layerStack, const int& i); + + virtual void delayDPTransactionIfNeeded( + const Vector<DisplayState>& /*displays*/) { } + + virtual bool canDrawLayerinScreenShot( + const sp<const DisplayDevice>& hw, + const sp<Layer>& layer); + + virtual void isfreezeSurfacePresent( + bool& freezeSurfacePresent, + const sp<const DisplayDevice>& /*hw*/, + const int32_t& /*id*/) { freezeSurfacePresent = false; } + + virtual void setOrientationEventControl( + bool& /*freezeSurfacePresent*/, + const int32_t& /*id*/) { } + + virtual void updateVisibleRegionsDirty() { } + + virtual void drawWormHoleIfRequired(HWComposer::LayerListIterator &cur, + const HWComposer::LayerListIterator &end, + const sp<const DisplayDevice>& hw, + const Region& region); + /* ------------------------------------------------------------------------ * Message handling */ void waitForEvent(); @@ -294,6 +344,10 @@ private: uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, sp<IGraphicBufferProducer>* outGbp, sp<Layer>* outLayer); + status_t createBlurLayer(const sp<Client>& client, const String8& name, + uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, + sp<IGraphicBufferProducer>* outGbp, sp<Layer>* outLayer); + // called in response to the window-manager calling // ISurfaceComposerClient::destroySurface() status_t onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle); @@ -329,7 +383,8 @@ private: const sp<IGraphicBufferProducer>& producer, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, - bool useIdentityTransform, Transform::orientation_flags rotation); + bool useIdentityTransform, Transform::orientation_flags rotation, + bool useReadPixels); /* ------------------------------------------------------------------------ * EGL @@ -373,7 +428,7 @@ private: * Compositing */ void invalidateHwcGeometry(); - static void computeVisibleRegions( + void computeVisibleRegions(size_t dpy, const LayerVector& currentLayers, uint32_t layerStack, Region& dirtyRegion, Region& opaqueRegion); @@ -419,6 +474,7 @@ private: void logFrameStats(); void dumpStaticScreenStats(String8& result) const; + virtual void dumpDrawCycle(bool /* prePrepare */ ) { } /* ------------------------------------------------------------------------ * Attributes @@ -500,12 +556,26 @@ private: mat4 mColorMatrix; bool mHasColorMatrix; + mat4 mSecondaryColorMatrix; + bool mHasSecondaryColorMatrix; + // Static screen stats bool mHasPoweredOff; static const size_t NUM_BUCKETS = 8; // < 1-7, 7+ nsecs_t mFrameBuckets[NUM_BUCKETS]; nsecs_t mTotalTime; nsecs_t mLastSwapTime; + + FrameRateHelper mFrameRateHelper; + + /* + * A number that increases on every new frame composition and screen capture. + * LayerBlur can speed up it's drawing by caching texture using this variable + * if multiple LayerBlur objects draw in one frame composition. + * In case of display mirroring, this variable should be increased on every display. + */ + uint32_t mActiveFrameSequence; + }; }; // namespace android |