Loading services/surfaceflinger/BufferLayer.h +31 −39 Original line number Diff line number Diff line Loading @@ -50,10 +50,7 @@ public: explicit BufferLayer(const LayerCreationArgs& args); virtual ~BufferLayer() override; // ----------------------------------------------------------------------- // Overriden from Layer // ----------------------------------------------------------------------- public: // Implements Layer. sp<compositionengine::LayerFE> getCompositionEngineLayerFE() const override; compositionengine::LayerFECompositionState* editCompositionState() override; Loading Loading @@ -118,41 +115,6 @@ public: ui::Transform::RotationFlags getTransformHint() const override { return mTransformHint; } // ----------------------------------------------------------------------- // Functions that must be implemented by derived classes // ----------------------------------------------------------------------- private: virtual bool fenceHasSignaled() const = 0; virtual bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const = 0; PixelFormat getPixelFormat() const; // Computes the transform matrix using the setFilteringEnabled to determine whether the // transform matrix should be computed for use with bilinear filtering. void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]); virtual uint64_t getFrameNumber(nsecs_t expectedPresentTime) const = 0; virtual bool getAutoRefresh() const = 0; virtual bool getSidebandStreamChanged() const = 0; // Latch sideband stream and returns true if the dirty region should be updated. virtual bool latchSidebandStream(bool& recomputeVisibleRegions) = 0; virtual bool hasFrameUpdate() const = 0; virtual status_t bindTextureImage() = 0; virtual status_t updateTexImage(bool& recomputeVisibleRegions, nsecs_t latchTime, nsecs_t expectedPresentTime) = 0; virtual status_t updateActiveBuffer() = 0; virtual status_t updateFrameNumber(nsecs_t latchTime) = 0; // We generate InputWindowHandles for all non-cursor buffered layers regardless of whether they // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion // detection. bool needsInputInfo() const override { return !mPotentialCursor; } protected: struct BufferInfo { nsecs_t mDesiredPresentTime; Loading Loading @@ -213,6 +175,30 @@ protected: ui::Transform::RotationFlags mTransformHint = ui::Transform::ROT_0; private: virtual bool fenceHasSignaled() const = 0; virtual bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const = 0; virtual uint64_t getFrameNumber(nsecs_t expectedPresentTime) const = 0; virtual bool getAutoRefresh() const = 0; virtual bool getSidebandStreamChanged() const = 0; // Latch sideband stream and returns true if the dirty region should be updated. virtual bool latchSidebandStream(bool& recomputeVisibleRegions) = 0; virtual bool hasFrameUpdate() const = 0; virtual status_t bindTextureImage() = 0; virtual status_t updateTexImage(bool& recomputeVisibleRegions, nsecs_t latchTime, nsecs_t expectedPresentTime) = 0; virtual status_t updateActiveBuffer() = 0; virtual status_t updateFrameNumber(nsecs_t latchTime) = 0; // We generate InputWindowHandles for all non-cursor buffered layers regardless of whether they // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion // detection. bool needsInputInfo() const override { return !mPotentialCursor; } // Returns true if this layer requires filtering bool needsFiltering(const DisplayDevice*) const override; bool needsFilteringForScreenshots(const DisplayDevice*, Loading @@ -222,6 +208,12 @@ private: // and its parent layer is not bounded Rect getBufferSize(const State& s) const override; PixelFormat getPixelFormat() const; // Computes the transform matrix using the setFilteringEnabled to determine whether the // transform matrix should be computed for use with bilinear filtering. void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]); std::unique_ptr<compositionengine::LayerFECompositionState> mCompositionState; FloatRect computeSourceBounds(const FloatRect& parentBounds) const override; Loading services/surfaceflinger/BufferQueueLayer.h +31 −43 Original line number Diff line number Diff line Loading @@ -35,10 +35,7 @@ public: explicit BufferQueueLayer(const LayerCreationArgs&); ~BufferQueueLayer() override; // ----------------------------------------------------------------------- // Interface implementation for Layer // ----------------------------------------------------------------------- public: // Implements Layer. const char* getType() const override { return "BufferQueueLayer"; } void onLayerDisplayed(const sp<Fence>& releaseFence) override; Loading @@ -54,14 +51,37 @@ public: bool shouldPresentNow(nsecs_t expectedPresentTime) const override; // ----------------------------------------------------------------------- // Implements BufferLayer. bool fenceHasSignaled() const override; bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const override; status_t setDefaultBufferProperties(uint32_t w, uint32_t h, PixelFormat format); sp<IGraphicBufferProducer> getProducer() const; protected: void gatherBufferInfo() override; // ----------------------------------------------------------------------- // Interface implementation for BufferLayer // Interface implementation for BufferLayerConsumer::ContentsChangedListener // ----------------------------------------------------------------------- class ContentsChangedListener : public BufferLayerConsumer::ContentsChangedListener { public: bool fenceHasSignaled() const override; bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const override; ContentsChangedListener(BufferQueueLayer* bufferQueueLayer) : mBufferQueueLayer(bufferQueueLayer) {} void abandon(); protected: void onFrameAvailable(const BufferItem& item) override; void onFrameReplaced(const BufferItem& item) override; void onSidebandStreamChanged() override; void onFrameDequeued(const uint64_t bufferId) override; void onFrameDetached(const uint64_t bufferId) override; void onFrameCancelled(const uint64_t bufferId) override; private: BufferQueueLayer* mBufferQueueLayer = nullptr; Mutex mMutex; }; private: uint64_t getFrameNumber(nsecs_t expectedPresentTime) const override; Loading @@ -83,6 +103,8 @@ private: sp<Layer> createClone() override; void onFirstRef() override; void onFrameAvailable(const BufferItem& item); void onFrameReplaced(const BufferItem& item); void onSidebandStreamChanged(); Loading @@ -90,43 +112,9 @@ private: void onFrameDetached(const uint64_t bufferId); void onFrameCancelled(const uint64_t bufferId); protected: void gatherBufferInfo() override; // ----------------------------------------------------------------------- // Interface implementation for BufferLayerConsumer::ContentsChangedListener // ----------------------------------------------------------------------- class ContentsChangedListener : public BufferLayerConsumer::ContentsChangedListener { public: ContentsChangedListener(BufferQueueLayer* bufferQueueLayer) : mBufferQueueLayer(bufferQueueLayer) {} void abandon(); protected: void onFrameAvailable(const BufferItem& item) override; void onFrameReplaced(const BufferItem& item) override; void onSidebandStreamChanged() override; void onFrameDequeued(const uint64_t bufferId) override; void onFrameDetached(const uint64_t bufferId) override; void onFrameCancelled(const uint64_t bufferId) override; private: BufferQueueLayer* mBufferQueueLayer = nullptr; Mutex mMutex; }; // ----------------------------------------------------------------------- public: status_t setDefaultBufferProperties(uint32_t w, uint32_t h, PixelFormat format); sp<IGraphicBufferProducer> getProducer() const; private: // Temporary - Used only for LEGACY camera mode. uint32_t getProducerStickyTransform() const; void onFirstRef() override; sp<BufferLayerConsumer> mConsumer; sp<IGraphicBufferProducer> mProducer; Loading services/surfaceflinger/BufferStateLayer.h +3 −5 Original line number Diff line number Diff line Loading @@ -36,9 +36,7 @@ public: ~BufferStateLayer() override; // ----------------------------------------------------------------------- // Interface implementation for Layer // ----------------------------------------------------------------------- // Implements Layer. const char* getType() const override { return "BufferStateLayer"; } void onLayerDisplayed(const sp<Fence>& releaseFence) override; Loading Loading @@ -117,6 +115,8 @@ protected: uint64_t getHeadFrameNumber(nsecs_t expectedPresentTime) const; private: friend class SlotGenerationTest; bool updateFrameEventHistory(const sp<Fence>& acquireFence, nsecs_t postedTime, nsecs_t requestedPresentTime); Loading @@ -141,8 +141,6 @@ private: // Crop that applies to the buffer Rect computeCrop(const State& s); private: friend class SlotGenerationTest; bool willPresentCurrentTransaction() const; static const std::array<float, 16> IDENTITY_MATRIX; Loading services/surfaceflinger/Client.h +0 −5 Original line number Diff line number Diff line Loading @@ -28,13 +28,9 @@ namespace android { // --------------------------------------------------------------------------- class Layer; class SurfaceFlinger; // --------------------------------------------------------------------------- class Client : public BnSurfaceComposerClient { public: Loading Loading @@ -80,7 +76,6 @@ private: mutable Mutex mLock; }; // --------------------------------------------------------------------------- }; // namespace android #endif // ANDROID_SF_CLIENT_H services/surfaceflinger/Colorizer.h +1 −6 Original line number Diff line number Diff line Loading @@ -21,8 +21,6 @@ namespace android { // --------------------------------------------------------------------------- class Colorizer { bool mEnabled; public: Loading Loading @@ -59,9 +57,6 @@ public: } }; // --------------------------------------------------------------------------- }; // namespace android } // namespace android #endif /* ANDROID_SURFACE_FLINGER_COLORIZER_H */ Loading
services/surfaceflinger/BufferLayer.h +31 −39 Original line number Diff line number Diff line Loading @@ -50,10 +50,7 @@ public: explicit BufferLayer(const LayerCreationArgs& args); virtual ~BufferLayer() override; // ----------------------------------------------------------------------- // Overriden from Layer // ----------------------------------------------------------------------- public: // Implements Layer. sp<compositionengine::LayerFE> getCompositionEngineLayerFE() const override; compositionengine::LayerFECompositionState* editCompositionState() override; Loading Loading @@ -118,41 +115,6 @@ public: ui::Transform::RotationFlags getTransformHint() const override { return mTransformHint; } // ----------------------------------------------------------------------- // Functions that must be implemented by derived classes // ----------------------------------------------------------------------- private: virtual bool fenceHasSignaled() const = 0; virtual bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const = 0; PixelFormat getPixelFormat() const; // Computes the transform matrix using the setFilteringEnabled to determine whether the // transform matrix should be computed for use with bilinear filtering. void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]); virtual uint64_t getFrameNumber(nsecs_t expectedPresentTime) const = 0; virtual bool getAutoRefresh() const = 0; virtual bool getSidebandStreamChanged() const = 0; // Latch sideband stream and returns true if the dirty region should be updated. virtual bool latchSidebandStream(bool& recomputeVisibleRegions) = 0; virtual bool hasFrameUpdate() const = 0; virtual status_t bindTextureImage() = 0; virtual status_t updateTexImage(bool& recomputeVisibleRegions, nsecs_t latchTime, nsecs_t expectedPresentTime) = 0; virtual status_t updateActiveBuffer() = 0; virtual status_t updateFrameNumber(nsecs_t latchTime) = 0; // We generate InputWindowHandles for all non-cursor buffered layers regardless of whether they // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion // detection. bool needsInputInfo() const override { return !mPotentialCursor; } protected: struct BufferInfo { nsecs_t mDesiredPresentTime; Loading Loading @@ -213,6 +175,30 @@ protected: ui::Transform::RotationFlags mTransformHint = ui::Transform::ROT_0; private: virtual bool fenceHasSignaled() const = 0; virtual bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const = 0; virtual uint64_t getFrameNumber(nsecs_t expectedPresentTime) const = 0; virtual bool getAutoRefresh() const = 0; virtual bool getSidebandStreamChanged() const = 0; // Latch sideband stream and returns true if the dirty region should be updated. virtual bool latchSidebandStream(bool& recomputeVisibleRegions) = 0; virtual bool hasFrameUpdate() const = 0; virtual status_t bindTextureImage() = 0; virtual status_t updateTexImage(bool& recomputeVisibleRegions, nsecs_t latchTime, nsecs_t expectedPresentTime) = 0; virtual status_t updateActiveBuffer() = 0; virtual status_t updateFrameNumber(nsecs_t latchTime) = 0; // We generate InputWindowHandles for all non-cursor buffered layers regardless of whether they // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion // detection. bool needsInputInfo() const override { return !mPotentialCursor; } // Returns true if this layer requires filtering bool needsFiltering(const DisplayDevice*) const override; bool needsFilteringForScreenshots(const DisplayDevice*, Loading @@ -222,6 +208,12 @@ private: // and its parent layer is not bounded Rect getBufferSize(const State& s) const override; PixelFormat getPixelFormat() const; // Computes the transform matrix using the setFilteringEnabled to determine whether the // transform matrix should be computed for use with bilinear filtering. void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]); std::unique_ptr<compositionengine::LayerFECompositionState> mCompositionState; FloatRect computeSourceBounds(const FloatRect& parentBounds) const override; Loading
services/surfaceflinger/BufferQueueLayer.h +31 −43 Original line number Diff line number Diff line Loading @@ -35,10 +35,7 @@ public: explicit BufferQueueLayer(const LayerCreationArgs&); ~BufferQueueLayer() override; // ----------------------------------------------------------------------- // Interface implementation for Layer // ----------------------------------------------------------------------- public: // Implements Layer. const char* getType() const override { return "BufferQueueLayer"; } void onLayerDisplayed(const sp<Fence>& releaseFence) override; Loading @@ -54,14 +51,37 @@ public: bool shouldPresentNow(nsecs_t expectedPresentTime) const override; // ----------------------------------------------------------------------- // Implements BufferLayer. bool fenceHasSignaled() const override; bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const override; status_t setDefaultBufferProperties(uint32_t w, uint32_t h, PixelFormat format); sp<IGraphicBufferProducer> getProducer() const; protected: void gatherBufferInfo() override; // ----------------------------------------------------------------------- // Interface implementation for BufferLayer // Interface implementation for BufferLayerConsumer::ContentsChangedListener // ----------------------------------------------------------------------- class ContentsChangedListener : public BufferLayerConsumer::ContentsChangedListener { public: bool fenceHasSignaled() const override; bool framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const override; ContentsChangedListener(BufferQueueLayer* bufferQueueLayer) : mBufferQueueLayer(bufferQueueLayer) {} void abandon(); protected: void onFrameAvailable(const BufferItem& item) override; void onFrameReplaced(const BufferItem& item) override; void onSidebandStreamChanged() override; void onFrameDequeued(const uint64_t bufferId) override; void onFrameDetached(const uint64_t bufferId) override; void onFrameCancelled(const uint64_t bufferId) override; private: BufferQueueLayer* mBufferQueueLayer = nullptr; Mutex mMutex; }; private: uint64_t getFrameNumber(nsecs_t expectedPresentTime) const override; Loading @@ -83,6 +103,8 @@ private: sp<Layer> createClone() override; void onFirstRef() override; void onFrameAvailable(const BufferItem& item); void onFrameReplaced(const BufferItem& item); void onSidebandStreamChanged(); Loading @@ -90,43 +112,9 @@ private: void onFrameDetached(const uint64_t bufferId); void onFrameCancelled(const uint64_t bufferId); protected: void gatherBufferInfo() override; // ----------------------------------------------------------------------- // Interface implementation for BufferLayerConsumer::ContentsChangedListener // ----------------------------------------------------------------------- class ContentsChangedListener : public BufferLayerConsumer::ContentsChangedListener { public: ContentsChangedListener(BufferQueueLayer* bufferQueueLayer) : mBufferQueueLayer(bufferQueueLayer) {} void abandon(); protected: void onFrameAvailable(const BufferItem& item) override; void onFrameReplaced(const BufferItem& item) override; void onSidebandStreamChanged() override; void onFrameDequeued(const uint64_t bufferId) override; void onFrameDetached(const uint64_t bufferId) override; void onFrameCancelled(const uint64_t bufferId) override; private: BufferQueueLayer* mBufferQueueLayer = nullptr; Mutex mMutex; }; // ----------------------------------------------------------------------- public: status_t setDefaultBufferProperties(uint32_t w, uint32_t h, PixelFormat format); sp<IGraphicBufferProducer> getProducer() const; private: // Temporary - Used only for LEGACY camera mode. uint32_t getProducerStickyTransform() const; void onFirstRef() override; sp<BufferLayerConsumer> mConsumer; sp<IGraphicBufferProducer> mProducer; Loading
services/surfaceflinger/BufferStateLayer.h +3 −5 Original line number Diff line number Diff line Loading @@ -36,9 +36,7 @@ public: ~BufferStateLayer() override; // ----------------------------------------------------------------------- // Interface implementation for Layer // ----------------------------------------------------------------------- // Implements Layer. const char* getType() const override { return "BufferStateLayer"; } void onLayerDisplayed(const sp<Fence>& releaseFence) override; Loading Loading @@ -117,6 +115,8 @@ protected: uint64_t getHeadFrameNumber(nsecs_t expectedPresentTime) const; private: friend class SlotGenerationTest; bool updateFrameEventHistory(const sp<Fence>& acquireFence, nsecs_t postedTime, nsecs_t requestedPresentTime); Loading @@ -141,8 +141,6 @@ private: // Crop that applies to the buffer Rect computeCrop(const State& s); private: friend class SlotGenerationTest; bool willPresentCurrentTransaction() const; static const std::array<float, 16> IDENTITY_MATRIX; Loading
services/surfaceflinger/Client.h +0 −5 Original line number Diff line number Diff line Loading @@ -28,13 +28,9 @@ namespace android { // --------------------------------------------------------------------------- class Layer; class SurfaceFlinger; // --------------------------------------------------------------------------- class Client : public BnSurfaceComposerClient { public: Loading Loading @@ -80,7 +76,6 @@ private: mutable Mutex mLock; }; // --------------------------------------------------------------------------- }; // namespace android #endif // ANDROID_SF_CLIENT_H
services/surfaceflinger/Colorizer.h +1 −6 Original line number Diff line number Diff line Loading @@ -21,8 +21,6 @@ namespace android { // --------------------------------------------------------------------------- class Colorizer { bool mEnabled; public: Loading Loading @@ -59,9 +57,6 @@ public: } }; // --------------------------------------------------------------------------- }; // namespace android } // namespace android #endif /* ANDROID_SURFACE_FLINGER_COLORIZER_H */