Loading libs/renderengine/gl/GLESRenderEngine.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading libs/renderengine/gl/GLESRenderEngine.h +2 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading libs/renderengine/include/renderengine/RenderEngine.h +5 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading libs/renderengine/include/renderengine/mock/RenderEngine.h +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading libs/renderengine/tests/RenderEngineTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
libs/renderengine/gl/GLESRenderEngine.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
libs/renderengine/gl/GLESRenderEngine.h +2 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading
libs/renderengine/include/renderengine/RenderEngine.h +5 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading
libs/renderengine/include/renderengine/mock/RenderEngine.h +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading
libs/renderengine/tests/RenderEngineTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -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