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

Commit a9aecbe3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Plumb fence from dequeueBuffer into renderengine"

parents b69cd650 6338c9d0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -789,13 +789,18 @@ bool GLESRenderEngine::useProtectedContext(bool useProtectedContext) {
status_t GLESRenderEngine::drawLayers(const DisplaySettings& display,
                                      const std::vector<LayerSettings>& layers,
                                      ANativeWindowBuffer* const buffer,
                                      base::unique_fd* drawFence) {
                                      base::unique_fd&& bufferFence, base::unique_fd* drawFence) {
    ATRACE_CALL();
    if (layers.empty()) {
        ALOGV("Drawing empty layer stack");
        return NO_ERROR;
    }

    if (bufferFence.get() >= 0 && !waitFence(std::move(bufferFence))) {
        ATRACE_NAME("Waiting before draw");
        sync_wait(bufferFence.get(), -1);
    }

    BindNativeBufferAsFramebuffer fbo(*this, buffer);

    if (fbo.getStatus() != NO_ERROR) {
+2 −1
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ public:
    bool supportsProtectedContent() const override;
    bool useProtectedContext(bool useProtectedContext) override;
    status_t drawLayers(const DisplaySettings& display, const std::vector<LayerSettings>& layers,
                        ANativeWindowBuffer* buffer, base::unique_fd* drawFence) override;
                        ANativeWindowBuffer* buffer, base::unique_fd&& bufferFence,
                        base::unique_fd* drawFence) override;

    // internal to RenderEngine
    EGLDisplay getEGLDisplay() const { return mEGLDisplay; }
+5 −2
Original line number Diff line number Diff line
@@ -167,7 +167,9 @@ public:
    // drawing any layers.
    // @param layers The layers to draw onto the display, in Z-order.
    // @param buffer The buffer which will be drawn to. This buffer will be
    // ready once displayFence fires.
    // ready once drawFence fires.
    // @param bufferFence Fence signalling that the buffer is ready to be drawn
    // to.
    // @param drawFence A pointer to a fence, which will fire when the buffer
    // has been drawn to and is ready to be examined. The fence will be
    // initialized by this method. The caller will be responsible for owning the
@@ -176,7 +178,8 @@ public:
    // now, this always returns NO_ERROR.
    virtual status_t drawLayers(const DisplaySettings& display,
                                const std::vector<LayerSettings>& layers,
                                ANativeWindowBuffer* buffer, base::unique_fd* drawFence) = 0;
                                ANativeWindowBuffer* buffer, base::unique_fd&& bufferFence,
                                base::unique_fd* drawFence) = 0;

protected:
    // Gets a framebuffer to render to. This framebuffer may or may not be
+2 −2
Original line number Diff line number Diff line
@@ -78,9 +78,9 @@ public:
    MOCK_CONST_METHOD0(isProtected, bool());
    MOCK_CONST_METHOD0(supportsProtectedContent, bool());
    MOCK_METHOD1(useProtectedContext, bool(bool));
    MOCK_METHOD4(drawLayers,
    MOCK_METHOD5(drawLayers,
                 status_t(const DisplaySettings&, const std::vector<LayerSettings>&,
                          ANativeWindowBuffer*, base::unique_fd*));
                          ANativeWindowBuffer*, base::unique_fd&&, base::unique_fd*));
};

} // namespace mock
+2 −1
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ struct RenderEngineTest : public ::testing::Test {
                           std::vector<renderengine::LayerSettings> layers,
                           sp<GraphicBuffer> buffer) {
        base::unique_fd fence;
        status_t status = sRE->drawLayers(settings, layers, buffer->getNativeBuffer(), &fence);
        status_t status = sRE->drawLayers(settings, layers, buffer->getNativeBuffer(),
                                          base::unique_fd(), &fence);

        int fd = fence.release();
        if (fd >= 0) {
Loading