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

Commit 955d54ac authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topic "fw_container"

* changes:
  DO NOT MERGE Change the logic of ContainerLayer's isVisible()
  SurfaceFlinger: Expose construction of container layers.
  Avoid calling into HWC in onFirstRef
parents 6729bce6 fe2975ef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ public:

        eFXSurfaceNormal = 0x00000000,
        eFXSurfaceColor = 0x00020000,
        eFXSurfaceContainer = 0x00080000,
        eFXSurfaceMask = 0x000F0000,
    };

+0 −4
Original line number Diff line number Diff line
@@ -30,10 +30,6 @@ ContainerLayer::ContainerLayer(SurfaceFlinger* flinger, const sp<Client>& client

void ContainerLayer::onDraw(const RenderArea&, const Region& /* clip */, bool) const {}

bool ContainerLayer::isVisible() const {
    return !isHiddenByPolicy();
}

void ContainerLayer::setPerFrameData(const sp<const DisplayDevice>&) {}

} // namespace android
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public:
    const char* getTypeId() const override { return "ContainerLayer"; }
    void onDraw(const RenderArea& renderArea, const Region& clip,
                bool useIdentityTransform) const override;
    bool isVisible() const override;
    bool isVisible() const override { return false; }

    void setPerFrameData(const sp<const DisplayDevice>& displayDevice) override;

+1 −16
Original line number Diff line number Diff line
@@ -133,22 +133,7 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, const String8& n
    CompositorTiming compositorTiming;
    flinger->getCompositorTiming(&compositorTiming);
    mFrameEventHistory.initializeCompositorTiming(compositorTiming);
}

void Layer::onFirstRef() NO_THREAD_SAFETY_ANALYSIS {
    if (!isCreatedFromMainThread()) {
        // Grab the SF state lock during this since it's the only way to safely access HWC
        mFlinger->mStateLock.lock();
    }

    const auto& hwc = mFlinger->getHwComposer();
    const auto& activeConfig = hwc.getActiveConfig(HWC_DISPLAY_PRIMARY);
    nsecs_t displayPeriod = activeConfig->getVsyncPeriod();
    mFrameTracker.setDisplayRefreshPeriod(displayPeriod);

    if (!isCreatedFromMainThread()) {
        mFlinger->mStateLock.unlock();
    }
    mFrameTracker.setDisplayRefreshPeriod(compositorTiming.interval);
}

Layer::~Layer() {
+0 −2
Original line number Diff line number Diff line
@@ -618,8 +618,6 @@ protected:
              : mFlinger(flinger), mLayer(layer) {}
    };

    virtual void onFirstRef();

    friend class impl::SurfaceInterceptor;

    void commitTransaction(const State& stateToCommit);
Loading