diff options
Diffstat (limited to 'services/surfaceflinger/Layer.h')
-rw-r--r-- | services/surfaceflinger/Layer.h | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index c1e5e9f..0d6ec41 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -57,6 +57,7 @@ class Colorizer; class DisplayDevice; class GraphicBuffer; class SurfaceFlinger; +class LayerBlur; // --------------------------------------------------------------------------- @@ -70,7 +71,12 @@ class SurfaceFlinger; class Layer : public SurfaceFlingerConsumer::ContentsChangedListener { static int32_t sSequence; + friend class LayerBlur; + public: +#ifdef QTI_BSP + friend class ExLayer; +#endif mutable bool contentDirty; // regions below are in window-manager space Region visibleRegion; @@ -89,11 +95,15 @@ public: }; struct Geometry { + float x; + float y; uint32_t w; uint32_t h; + bool isPositionPending; Rect crop; inline bool operator ==(const Geometry& rhs) const { - return (w == rhs.w && h == rhs.h && crop == rhs.crop); + return (w == rhs.w && h == rhs.h && crop == rhs.crop && x == rhs.x && y == rhs.y + && isPositionPending == rhs.isPositionPending); } inline bool operator !=(const Geometry& rhs) const { return !operator ==(rhs); @@ -105,6 +115,7 @@ public: Geometry requested; uint32_t z; uint32_t layerStack; + uint8_t blur; uint8_t alpha; uint8_t flags; uint8_t reserved[2]; @@ -130,6 +141,10 @@ public: // modify current state bool setPosition(float x, float y); bool setLayer(uint32_t z); + bool setBlur(uint8_t blur); + virtual bool setBlurMaskLayer(sp<Layer>& /*maskLayer*/) { return false; } + virtual bool setBlurMaskSampling(int32_t /*sampling*/) { return false; } + virtual bool setBlurMaskAlphaThreshold(float /*alpha*/) { return false; } bool setSize(uint32_t w, uint32_t h); bool setAlpha(uint8_t alpha); bool setMatrix(const layer_state_t::matrix22_t& matrix); @@ -147,8 +162,13 @@ public: uint32_t getTransactionFlags(uint32_t flags); uint32_t setTransactionFlags(uint32_t flags); +#ifdef QTI_BSP + virtual void computeGeometry(const sp<const DisplayDevice>& hw, Mesh& mesh, + bool useIdentityTransform) const; +#else void computeGeometry(const sp<const DisplayDevice>& hw, Mesh& mesh, bool useIdentityTransform) const; +#endif Rect computeBounds(const Region& activeTransparentRegion) const; Rect computeBounds() const; @@ -192,19 +212,24 @@ public: */ virtual bool isFixedSize() const; + /* + * isBlurLayer - true if this is a LayerBlur instance + */ + virtual bool isBlurLayer() const { return false; } + protected: /* * onDraw - draws the surface. */ virtual void onDraw(const sp<const DisplayDevice>& hw, const Region& clip, - bool useIdentityTransform) const; + bool useIdentityTransform); public: // ----------------------------------------------------------------------- void setGeometry(const sp<const DisplayDevice>& hw, HWComposer::HWCLayerInterface& layer); - void setPerFrameData(const sp<const DisplayDevice>& hw, + virtual void setPerFrameData(const sp<const DisplayDevice>& hw, HWComposer::HWCLayerInterface& layer); void setAcquireFence(const sp<const DisplayDevice>& hw, HWComposer::HWCLayerInterface& layer); @@ -234,9 +259,9 @@ public: * draw - performs some global clipping optimizations * and calls onDraw(). */ - void draw(const sp<const DisplayDevice>& hw, const Region& clip) const; - void draw(const sp<const DisplayDevice>& hw, bool useIdentityTransform) const; - void draw(const sp<const DisplayDevice>& hw) const; + void draw(const sp<const DisplayDevice>& hw, const Region& clip); + void draw(const sp<const DisplayDevice>& hw, bool useIdentityTransform); + void draw(const sp<const DisplayDevice>& hw); /* * doTransaction - process the transaction. This is a good place to figure @@ -283,7 +308,22 @@ public: // Updates the transform hint in our SurfaceFlingerConsumer to match // the current orientation of the display device. - void updateTransformHint(const sp<const DisplayDevice>& hw) const; + void updateTransformHint(const sp<const DisplayDevice>& hw) ; + + /* ------------------------------------------------------------------------ + * Extensions + */ + virtual bool isExtOnly() const { return false; } + virtual bool isIntOnly() const { return false; } + virtual bool isSecureDisplay() const { return false; } + virtual bool isYuvLayer() const { return false; } + virtual void setPosition(const sp<const DisplayDevice>& /*hw*/, + HWComposer::HWCLayerInterface& /*layer*/, + const State& /*state*/) { } + virtual void setAcquiredFenceIfBlit(int& /*fenceFd */, + HWComposer::HWCLayerInterface& /*layer */) { } + virtual bool canAllowGPUForProtected() const { return false; } + /* * returns the rectangle that crops the content of the layer and scales it @@ -336,6 +376,7 @@ protected: LayerCleaner(const sp<SurfaceFlinger>& flinger, const sp<Layer>& layer); }; + Rect reduce(const Rect& win, const Region& exclude) const; private: // Interface implementation for SurfaceFlingerConsumer::ContentsChangedListener @@ -356,9 +397,14 @@ private: // drawing void clearWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip, float r, float g, float b, float alpha) const; +#ifdef QTI_BSP + virtual void drawWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip, + bool useIdentityTransform) const; +#else void drawWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip, bool useIdentityTransform) const; +#endif // Temporary - Used only for LEGACY camera mode. uint32_t getProducerStickyTransform() const; @@ -419,6 +465,7 @@ private: Vector<BufferItem> mQueueItems; uint64_t mLastFrameNumberReceived; bool mUpdateTexImageFailed; // This is only modified from the main thread + uint32_t mTransformHint; }; // --------------------------------------------------------------------------- |