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

Commit b15d2279 authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

[CE] Separate framebuffer space from display space

Some devices have limited GPU capabilities and they
cannot perform client composition at the resolution
of the active display mode. For this reason the
framebuffer size can be limited with the sysrops
ro.surface_flinger.max_graphics_height|width.

As the framebuffer size can differ from the display
size, in this CL we separate the concepts for
framebuffer space and display space so we properly
render.

Bug: 161793589
Bug: 168788659
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Test: 1. adb shell service call SurfaceFlinger 1008 i32 1
      2. make sure content is rendered properly
      3. adb shell service call SurfaceFlinger 1008 i32 0
      4. make sure content is rendered properly
Test: play YouTube video

Change-Id: I17d54ef8c85773c072f0c38f576f3f3be504d6ec
parent b2d6a712
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -202,6 +202,15 @@ public:
    // the input.
    Rect transform(uint32_t xform, int32_t width, int32_t height) const;

    Rect scale(float scaleX, float scaleY) const {
        return Rect(FloatRect(left * scaleX, top * scaleY, right * scaleX, bottom * scaleY));
    }

    Rect& scaleSelf(float scaleX, float scaleY) {
        set(scale(scaleX, scaleY));
        return *this;
    }

    // this calculates (Region(*this) - exclude).bounds() efficiently
    Rect reduce(const Rect& exclude) const;

+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ public:
    virtual void setProjection(ui::Rotation orientation, const Rect& layerStackSpaceRect,
                               const Rect& orientedDisplaySpaceRect) = 0;
    // Sets the bounds to use
    virtual void setDisplaySpaceSize(const ui::Size&) = 0;
    virtual void setDisplaySize(const ui::Size&) = 0;

    // Sets the layer stack filtering settings for this output. See
    // belongsInOutput for full details.
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ public:
    void setCompositionEnabled(bool) override;
    void setProjection(ui::Rotation orientation, const Rect& layerStackSpaceRect,
                       const Rect& orientedDisplaySpaceRect) override;
    void setDisplaySpaceSize(const ui::Size&) override;
    void setDisplaySize(const ui::Size&) override;
    void setLayerStackFilter(uint32_t layerStackId, bool isInternal) override;

    void setColorTransform(const compositionengine::CompositionRefreshArgs&) override;
+6 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ namespace android {
namespace compositionengine::impl {

struct OutputCompositionState {
    // If false, composition will not per performed for this display
    // If false, composition will not be performed for this display
    bool isEnabled{false};

    // If false, this output is not considered secure
@@ -71,6 +71,11 @@ struct OutputCompositionState {
    // match the orientation of layerStackSpace. The orientation of this space is always ROTATION_0.
    ProjectionSpace orientedDisplaySpace;

    // The space of the framebuffer. Its bounds match the size of the framebuffer and its
    // orientation matches the orientation of the display. Typically the framebuffer space will
    // be identical to the physical display space.
    ProjectionSpace framebufferSpace;

    // The space of the physical display. It is as big as the currently active display mode. The
    // content in this space can be rotated.
    ProjectionSpace displaySpace;
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public:

    MOCK_METHOD1(setCompositionEnabled, void(bool));
    MOCK_METHOD3(setProjection, void(ui::Rotation, const Rect&, const Rect&));
    MOCK_METHOD1(setDisplaySpaceSize, void(const ui::Size&));
    MOCK_METHOD1(setDisplaySize, void(const ui::Size&));
    MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool));

    MOCK_METHOD1(setColorTransform, void(const compositionengine::CompositionRefreshArgs&));
Loading