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

Commit 8b946c05 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Defer layer rendering to avoid stalls Bug #7326824" into jb-mr1-dev

parents 0ed07a0a 7c25aab4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1200,7 +1200,12 @@ public abstract class HardwareRenderer {
                            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
                        }

                        Trace.traceBegin(Trace.TRACE_TAG_VIEW, "prepareFrame");
                        try {
                            status = onPreDraw(dirty);
                        } finally {
                            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
                        }
                        saveCount = canvas.save();
                        callbacks.onHardwarePreDraw(canvas);

+1 −1
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@ void DisplayListRenderer::setViewport(int width, int height) {
    mHeight = height;
}

int DisplayListRenderer::prepareDirty(float left, float top,
status_t DisplayListRenderer::prepareDirty(float left, float top,
        float right, float bottom, bool opaque) {
    mSnapshot = new Snapshot(mFirstSnapshot,
            SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
+1 −1
Original line number Diff line number Diff line
@@ -550,7 +550,7 @@ public:
    virtual bool isDeferred();

    virtual void setViewport(int width, int height);
    virtual int prepareDirty(float left, float top, float right, float bottom, bool opaque);
    virtual status_t prepareDirty(float left, float top, float right, float bottom, bool opaque);
    virtual void finish();

    virtual status_t callDrawGLFunction(Functor *functor, Rect& dirty);
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ Layer::Layer(const uint32_t layerWidth, const uint32_t layerHeight) {
    meshIndices = NULL;
    meshElementCount = 0;
    cacheable = true;
    dirty = false;
    textureLayer = false;
    renderTarget = GL_TEXTURE_2D;
    texture.width = layerWidth;
+14 −0
Original line number Diff line number Diff line
@@ -162,6 +162,14 @@ struct Layer {
        this->cacheable = cacheable;
    }

    inline bool isDirty() {
        return dirty;
    }

    inline void setDirty(bool dirty) {
        this->dirty = dirty;
    }

    inline bool isTextureLayer() {
        return textureLayer;
    }
@@ -286,6 +294,12 @@ private:
     */
    bool textureLayer;

    /**
     * When set to true, this layer is dirty and should be cleared
     * before any rendering occurs.
     */
    bool dirty;

    /**
     * Indicates the render target.
     */
Loading