Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e169ee5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move LayerFilter to SurfaceFlinger" into main

parents 27d3859c 10c9f839
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -61,24 +61,4 @@ inline bool operator<(LayerStack lhs, LayerStack rhs) {
    return lhs.id < rhs.id;
}

// A LayerFilter determines if a layer is included for output to a display.
struct LayerFilter {
    LayerStack layerStack;

    // True if the layer is only output to internal displays, i.e. excluded from screenshots, screen
    // recordings, and mirroring to virtual or external displays. Used for display cutout overlays.
    bool toInternalDisplay = false;

    // Returns true if the input filter can be output to this filter.
    bool includes(LayerFilter other) const {
        // The layer stacks must match.
        if (other.layerStack == UNASSIGNED_LAYER_STACK || other.layerStack != layerStack) {
            return false;
        }

        // The output must be to an internal display if the input filter has that constraint.
        return !other.toInternalDisplay || toInternalDisplay;
    }
};

} // namespace android::ui
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <android/gui/BorderSettings.h>
#include <android/gui/BoxShadowSettings.h>
#include <android/gui/CachingHint.h>
#include <common/LayerFilter.h>
#include <gui/DisplayLuts.h>
#include <gui/HdrMetadata.h>
#include <math/mat4.h>
@@ -105,7 +106,7 @@ struct LayerFECompositionState {
     */

    // The filter that determines which outputs include this layer
    ui::LayerFilter outputFilter;
    LayerFilter outputFilter;

    // If false, this layer should not be considered visible
    bool isVisible{true};
+3 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <utility>
#include <vector>

#include <common/LayerFilter.h>
#include <compositionengine/LayerFE.h>
#include <renderengine/LayerSettings.h>
#include <ui/Fence.h>
@@ -196,7 +197,7 @@ public:
    virtual ui::Transform::RotationFlags getTransformHint() const = 0;

    // Sets the filter for this output. See Output::includesLayer.
    virtual void setLayerFilter(ui::LayerFilter) = 0;
    virtual void setLayerFilter(LayerFilter) = 0;

    // Sets the output color mode
    virtual void setColorProfile(const ColorProfile&) = 0;
@@ -239,7 +240,7 @@ public:

    // Returns whether the output includes a layer, based on their respective filters.
    // See Output::setLayerFilter.
    virtual bool includesLayer(ui::LayerFilter) const = 0;
    virtual bool includesLayer(LayerFilter) const = 0;
    virtual bool includesLayer(const sp<LayerFE>&) const = 0;
    virtual bool includesLayer(LayerFE*) const = 0;

+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <string>
#include <type_traits>

#include <common/LayerFilter.h>
#include <math/mat4.h>
#include <ui/FloatRect.h>
#include <ui/LayerStack.h>
@@ -54,7 +55,7 @@ void dumpVal(std::string& out, const char* name, const std::string& valueName, E
    dumpVal(out, name, valueName, static_cast<std::underlying_type_t<EnumType>>(value));
}

void dumpVal(std::string& out, const char* name, ui::LayerFilter);
void dumpVal(std::string& out, const char* name, LayerFilter);
void dumpVal(std::string& out, const char* name, ui::Size);

void dumpVal(std::string& out, const char* name, const FloatRect&);
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public:
                       const Rect& orientedDisplaySpaceRect) override;
    void setNextBrightness(float brightness) override;
    void setDisplaySize(const ui::Size&) override;
    void setLayerFilter(ui::LayerFilter) override;
    void setLayerFilter(LayerFilter) override;
    ui::Transform::RotationFlags getTransformHint() const override;

    void setColorTransform(const compositionengine::CompositionRefreshArgs&) override;
@@ -74,7 +74,7 @@ public:

    Region getDirtyRegion() const override;

    bool includesLayer(ui::LayerFilter) const override;
    bool includesLayer(LayerFilter) const override;
    bool includesLayer(const sp<LayerFE>&) const override;
    bool includesLayer(LayerFE*) const override;

Loading