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

Commit 650bd9a7 authored by John Reck's avatar John Reck
Browse files

Make HWUI's surface Reliable^TM

You won't believe this one weird trick to make
EGL_BAD_ALLOC errors never happen again! libgui
hates it!

Bug: way too many to list
Test: none - there probably should be, though
Change-Id: I8e7fc3e584f90c01e0fd932497604a1d93710ba6
parent 9a72ec33
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ cc_defaults {
        "renderthread/CanvasContext.cpp",
        "renderthread/DrawFrameTask.cpp",
        "renderthread/EglManager.cpp",
        "renderthread/ReliableSurface.cpp",
        "renderthread/VulkanManager.cpp",
        "renderthread/RenderProxy.cpp",
        "renderthread/RenderTask.cpp",
+1 −1
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ void SkiaOpenGLPipeline::onStop() {
    }
}

bool SkiaOpenGLPipeline::setSurface(Surface* surface, SwapBehavior swapBehavior,
bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior,
                                    ColorMode colorMode) {
    if (mEglSurface != EGL_NO_SURFACE) {
        mEglManager.destroySurface(mEglSurface);
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public:
    bool swapBuffers(const renderthread::Frame& frame, bool drew, const SkRect& screenDirty,
                     FrameInfo* currentFrameInfo, bool* requireSwap) override;
    DeferredLayerUpdater* createTextureLayer() override;
    bool setSurface(Surface* window, renderthread::SwapBehavior swapBehavior,
    bool setSurface(ANativeWindow* surface, renderthread::SwapBehavior swapBehavior,
                    renderthread::ColorMode colorMode) override;
    void onStop() override;
    bool isSurfaceReady() override;
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ DeferredLayerUpdater* SkiaVulkanPipeline::createTextureLayer() {

void SkiaVulkanPipeline::onStop() {}

bool SkiaVulkanPipeline::setSurface(Surface* surface, SwapBehavior swapBehavior,
bool SkiaVulkanPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior,
                                    ColorMode colorMode) {
    if (mVkSurface) {
        mVkManager.destroySurface(mVkSurface);
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public:
    bool swapBuffers(const renderthread::Frame& frame, bool drew, const SkRect& screenDirty,
                     FrameInfo* currentFrameInfo, bool* requireSwap) override;
    DeferredLayerUpdater* createTextureLayer() override;
    bool setSurface(Surface* window, renderthread::SwapBehavior swapBehavior,
    bool setSurface(ANativeWindow* surface, renderthread::SwapBehavior swapBehavior,
                    renderthread::ColorMode colorMode) override;
    void onStop() override;
    bool isSurfaceReady() override;
Loading