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

Commit 7825c68e authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: default display is active display

For devices with multiple internal displays, choose the internal
display the is powered on (if any) to be the default display that
would be used mainly for vsync tracking.

Bug: 187539899
Test: SF unit tests
Change-Id: Icc305cdeec1c8a04729f00ff795dfbb806d8f72c
Merged-In: Icc305cdeec1c8a04729f00ff795dfbb806d8f72c
parent bef8b852
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public:
    void cleanupPostRender() override;
    int getContextPriority() override;
    bool supportsBackgroundBlur() override { return mBlurFilter != nullptr; }
    void onPrimaryDisplaySizeChanged(ui::Size size) override {}
    void onActiveDisplaySizeChanged(ui::Size size) override {}

    EGLDisplay getEGLDisplay() const { return mEGLDisplay; }
    // Creates an output image for rendering to
+2 −2
Original line number Diff line number Diff line
@@ -129,9 +129,9 @@ public:
    // Attempt to switch RenderEngine into and out of protectedContext mode
    virtual bool useProtectedContext(bool useProtectedContext) = 0;

    // Notify RenderEngine of changes to the dimensions of the primary display
    // Notify RenderEngine of changes to the dimensions of the active display
    // so that it can configure its internal caches accordingly.
    virtual void onPrimaryDisplaySizeChanged(ui::Size size) = 0;
    virtual void onActiveDisplaySizeChanged(ui::Size size) = 0;

    // Renders layers for a particular display via GPU composition. This method
    // should be called for every display that needs to be rendered via the GPU.
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public:
    MOCK_METHOD0(cleanFramebufferCache, void());
    MOCK_METHOD0(getContextPriority, int());
    MOCK_METHOD0(supportsBackgroundBlur, bool());
    MOCK_METHOD1(onPrimaryDisplaySizeChanged, void(ui::Size));
    MOCK_METHOD1(onActiveDisplaySizeChanged, void(ui::Size));

protected:
    // mock renderengine still needs to implement these, but callers should never need to call them.
+1 −1
Original line number Diff line number Diff line
@@ -1401,7 +1401,7 @@ int SkiaGLRenderEngine::getContextPriority() {
    return value;
}

void SkiaGLRenderEngine::onPrimaryDisplaySizeChanged(ui::Size size) {
void SkiaGLRenderEngine::onActiveDisplaySizeChanged(ui::Size size) {
    // This cache multiplier was selected based on review of cache sizes relative
    // to the screen resolution. Looking at the worst case memory needed by blur (~1.5x),
    // shadows (~1x), and general data structures (e.g. vertex buffers) we selected this as a
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public:
    bool useProtectedContext(bool useProtectedContext) override;
    bool supportsBackgroundBlur() override { return mBlurFilter != nullptr; }
    void assertShadersCompiled(int numShaders) override;
    void onPrimaryDisplaySizeChanged(ui::Size size) override;
    void onActiveDisplaySizeChanged(ui::Size size) override;
    int reportShadersCompiled() override;

protected:
Loading