Loading services/surfaceflinger/CompositionEngine/include/compositionengine/Output.h +11 −7 Original line number Diff line number Diff line Loading @@ -52,11 +52,9 @@ public: // Sets the bounds to use virtual void setBounds(const ui::Size&) = 0; // Sets the layer stack filter for this output. If singleLayerStack is true, // this output displays just the single layer stack specified by // singleLayerStackId. Otherwise all layer stacks will be visible on this // output. virtual void setLayerStackFilter(bool singleLayerStack, uint32_t singleLayerStackId) = 0; // Sets the layer stack filtering settings for this output. See // belongsInOutput for full details. virtual void setLayerStackFilter(uint32_t layerStackId, bool isInternal) = 0; // Sets the color transform matrix to use virtual void setColorTransform(const mat4&) = 0; Loading Loading @@ -96,8 +94,14 @@ public: // logical (aka layer stack) space. virtual Region getPhysicalSpaceDirtyRegion(bool repaintEverything) const = 0; // Tests whether a given layerStackId belongs in this output virtual bool belongsInOutput(uint32_t layerStackId) const = 0; // Tests whether a given layerStackId belongs in this output. // A layer belongs to the output if its layerStackId matches the of the output layerStackId, // unless the layer should display on the primary output only and this is not the primary output // A layer belongs to the output if its layerStackId matches. Additionally // if the layer should only show in the internal (primary) display only and // this output allows that. virtual bool belongsInOutput(uint32_t layerStackId, bool internalOnly) const = 0; protected: ~Output() = default; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Output.h +2 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public: void setProjection(const ui::Transform&, int32_t orientation, const Rect& frame, const Rect& viewport, const Rect& scissor, bool needsFiltering) override; void setBounds(const ui::Size&) override; void setLayerStackFilter(bool singleLayerStack, uint32_t singleLayerStackId) override; void setLayerStackFilter(uint32_t layerStackId, bool isInternal) override; void setColorTransform(const mat4&) override; void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent) override; Loading @@ -58,7 +58,7 @@ public: OutputCompositionState& editState() override; Region getPhysicalSpaceDirtyRegion(bool repaintEverything) const override; bool belongsInOutput(uint32_t) const override; bool belongsInOutput(uint32_t, bool) const override; // Testing void setDisplayColorProfileForTest(std::unique_ptr<compositionengine::DisplayColorProfile>); Loading services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputCompositionState.h +3 −4 Original line number Diff line number Diff line Loading @@ -34,12 +34,11 @@ struct OutputCompositionState { // If false, this output is not considered secure bool isSecure{false}; // If true, only layer stacks with a matching layerStack value will be // displayed. If false, all layer stacks will be displayed. bool singleLayerStack{true}; // If true, this output displays layers that are internal-only bool layerStackInternal{false}; // The layer stack to display on this display uint32_t singleLayerStackId{~0u}; uint32_t layerStackId{~0u}; // The physical space screen bounds Rect bounds; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/mock/Output.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public: MOCK_METHOD6(setProjection, void(const ui::Transform&, int32_t, const Rect&, const Rect&, const Rect&, bool)); MOCK_METHOD1(setBounds, void(const ui::Size&)); MOCK_METHOD2(setLayerStackFilter, void(bool, uint32_t)); MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool)); MOCK_METHOD1(setColorTransform, void(const mat4&)); MOCK_METHOD3(setColorMode, void(ui::ColorMode, ui::Dataspace, ui::RenderIntent)); Loading @@ -54,7 +54,7 @@ public: MOCK_METHOD0(editState, OutputCompositionState&()); MOCK_CONST_METHOD1(getPhysicalSpaceDirtyRegion, Region(bool)); MOCK_CONST_METHOD1(belongsInOutput, bool(uint32_t)); MOCK_CONST_METHOD2(belongsInOutput, bool(uint32_t, bool)); }; } // namespace android::compositionengine::mock services/surfaceflinger/CompositionEngine/src/Output.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -75,9 +75,9 @@ void Output::setBounds(const ui::Size& size) { dirtyEntireOutput(); } void Output::setLayerStackFilter(bool singleLayerStack, uint32_t singleLayerStackId) { mState.singleLayerStack = singleLayerStack; mState.singleLayerStackId = singleLayerStackId; void Output::setLayerStackFilter(uint32_t layerStackId, bool isInternal) { mState.layerStackId = layerStackId; mState.layerStackInternal = isInternal; dirtyEntireOutput(); } Loading Loading @@ -175,8 +175,10 @@ Region Output::getPhysicalSpaceDirtyRegion(bool repaintEverything) const { return dirty; } bool Output::belongsInOutput(uint32_t layerStackId) const { return !mState.singleLayerStack || (layerStackId == mState.singleLayerStackId); bool Output::belongsInOutput(uint32_t layerStackId, bool internalOnly) const { // The layerStackId's must match, and also the layer must not be internal // only when not on an internal output. return (layerStackId == mState.layerStackId) && (!internalOnly || mState.layerStackInternal); } void Output::dirtyEntireOutput() { Loading Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/Output.h +11 −7 Original line number Diff line number Diff line Loading @@ -52,11 +52,9 @@ public: // Sets the bounds to use virtual void setBounds(const ui::Size&) = 0; // Sets the layer stack filter for this output. If singleLayerStack is true, // this output displays just the single layer stack specified by // singleLayerStackId. Otherwise all layer stacks will be visible on this // output. virtual void setLayerStackFilter(bool singleLayerStack, uint32_t singleLayerStackId) = 0; // Sets the layer stack filtering settings for this output. See // belongsInOutput for full details. virtual void setLayerStackFilter(uint32_t layerStackId, bool isInternal) = 0; // Sets the color transform matrix to use virtual void setColorTransform(const mat4&) = 0; Loading Loading @@ -96,8 +94,14 @@ public: // logical (aka layer stack) space. virtual Region getPhysicalSpaceDirtyRegion(bool repaintEverything) const = 0; // Tests whether a given layerStackId belongs in this output virtual bool belongsInOutput(uint32_t layerStackId) const = 0; // Tests whether a given layerStackId belongs in this output. // A layer belongs to the output if its layerStackId matches the of the output layerStackId, // unless the layer should display on the primary output only and this is not the primary output // A layer belongs to the output if its layerStackId matches. Additionally // if the layer should only show in the internal (primary) display only and // this output allows that. virtual bool belongsInOutput(uint32_t layerStackId, bool internalOnly) const = 0; protected: ~Output() = default; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Output.h +2 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public: void setProjection(const ui::Transform&, int32_t orientation, const Rect& frame, const Rect& viewport, const Rect& scissor, bool needsFiltering) override; void setBounds(const ui::Size&) override; void setLayerStackFilter(bool singleLayerStack, uint32_t singleLayerStackId) override; void setLayerStackFilter(uint32_t layerStackId, bool isInternal) override; void setColorTransform(const mat4&) override; void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent) override; Loading @@ -58,7 +58,7 @@ public: OutputCompositionState& editState() override; Region getPhysicalSpaceDirtyRegion(bool repaintEverything) const override; bool belongsInOutput(uint32_t) const override; bool belongsInOutput(uint32_t, bool) const override; // Testing void setDisplayColorProfileForTest(std::unique_ptr<compositionengine::DisplayColorProfile>); Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputCompositionState.h +3 −4 Original line number Diff line number Diff line Loading @@ -34,12 +34,11 @@ struct OutputCompositionState { // If false, this output is not considered secure bool isSecure{false}; // If true, only layer stacks with a matching layerStack value will be // displayed. If false, all layer stacks will be displayed. bool singleLayerStack{true}; // If true, this output displays layers that are internal-only bool layerStackInternal{false}; // The layer stack to display on this display uint32_t singleLayerStackId{~0u}; uint32_t layerStackId{~0u}; // The physical space screen bounds Rect bounds; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/mock/Output.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public: MOCK_METHOD6(setProjection, void(const ui::Transform&, int32_t, const Rect&, const Rect&, const Rect&, bool)); MOCK_METHOD1(setBounds, void(const ui::Size&)); MOCK_METHOD2(setLayerStackFilter, void(bool, uint32_t)); MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool)); MOCK_METHOD1(setColorTransform, void(const mat4&)); MOCK_METHOD3(setColorMode, void(ui::ColorMode, ui::Dataspace, ui::RenderIntent)); Loading @@ -54,7 +54,7 @@ public: MOCK_METHOD0(editState, OutputCompositionState&()); MOCK_CONST_METHOD1(getPhysicalSpaceDirtyRegion, Region(bool)); MOCK_CONST_METHOD1(belongsInOutput, bool(uint32_t)); MOCK_CONST_METHOD2(belongsInOutput, bool(uint32_t, bool)); }; } // namespace android::compositionengine::mock
services/surfaceflinger/CompositionEngine/src/Output.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -75,9 +75,9 @@ void Output::setBounds(const ui::Size& size) { dirtyEntireOutput(); } void Output::setLayerStackFilter(bool singleLayerStack, uint32_t singleLayerStackId) { mState.singleLayerStack = singleLayerStack; mState.singleLayerStackId = singleLayerStackId; void Output::setLayerStackFilter(uint32_t layerStackId, bool isInternal) { mState.layerStackId = layerStackId; mState.layerStackInternal = isInternal; dirtyEntireOutput(); } Loading Loading @@ -175,8 +175,10 @@ Region Output::getPhysicalSpaceDirtyRegion(bool repaintEverything) const { return dirty; } bool Output::belongsInOutput(uint32_t layerStackId) const { return !mState.singleLayerStack || (layerStackId == mState.singleLayerStackId); bool Output::belongsInOutput(uint32_t layerStackId, bool internalOnly) const { // The layerStackId's must match, and also the layer must not be internal // only when not on an internal output. return (layerStackId == mState.layerStackId) && (!internalOnly || mState.layerStackInternal); } void Output::dirtyEntireOutput() { Loading