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

Commit e459367a authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Use const access to snapshot from OpenGLRenderer"

parents 23ab74de d6b65f67
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -218,19 +218,19 @@ void DisplayListRenderer::concatMatrix(SkMatrix* matrix) {
bool DisplayListRenderer::clipRect(float left, float top, float right, float bottom,
        SkRegion::Op op) {
    addStateOp(new (alloc()) ClipRectOp(left, top, right, bottom, op));
    return OpenGLRenderer::clipRect(left, top, right, bottom, op);
    return StatefulBaseRenderer::clipRect(left, top, right, bottom, op);
}

bool DisplayListRenderer::clipPath(SkPath* path, SkRegion::Op op) {
    path = refPath(path);
    addStateOp(new (alloc()) ClipPathOp(path, op));
    return OpenGLRenderer::clipPath(path, op);
    return StatefulBaseRenderer::clipPath(path, op);
}

bool DisplayListRenderer::clipRegion(SkRegion* region, SkRegion::Op op) {
    region = refRegion(region);
    addStateOp(new (alloc()) ClipRegionOp(region, op));
    return OpenGLRenderer::clipRegion(region, op);
    return StatefulBaseRenderer::clipRegion(region, op);
}

status_t DisplayListRenderer::drawDisplayList(DisplayList* displayList,
@@ -242,7 +242,8 @@ status_t DisplayListRenderer::drawDisplayList(DisplayList* displayList,
    //       resources cache, but we rely on the caller (UI toolkit) to
    //       do the right thing for now

    DrawDisplayListOp* op = new (alloc()) DrawDisplayListOp(displayList, flags, currentTransform());
    DrawDisplayListOp* op = new (alloc()) DrawDisplayListOp(displayList,
            flags, *currentTransform());
    addDrawOp(op);
    mDisplayListData->children.push(op);

+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ class DrawOp;
class StateOp;

/**
 * Records drawing commands in a display list for latter playback.
 * Records drawing commands in a display list for later playback into an OpenGLRenderer.
 */
class DisplayListRenderer: public OpenGLRenderer {
public:
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void LayerRenderer::ensureStencilBuffer() {
///////////////////////////////////////////////////////////////////////////////

Region* LayerRenderer::getRegion() const {
    if (getSnapshot()->flags & Snapshot::kFlagFboTarget) {
    if (currentSnapshot()->flags & Snapshot::kFlagFboTarget) {
        return OpenGLRenderer::getRegion();
    }
    return &mLayer->region;
+127 −177

File changed.

Preview size limit exceeded, changes collapsed.

+5 −17
Original line number Diff line number Diff line
@@ -170,10 +170,6 @@ public:
    int saveLayerDeferred(float left, float top, float right, float bottom,
            int alpha, SkXfermode::Mode mode, int flags);

    virtual bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op);
    virtual bool clipPath(SkPath* path, SkRegion::Op op);
    virtual bool clipRegion(SkRegion* region, SkRegion::Op op);

    virtual status_t drawDisplayList(DisplayList* displayList, Rect& dirty, int32_t replayFlags);
    virtual status_t drawLayer(Layer* layer, float x, float y);
    virtual status_t drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint);
@@ -246,7 +242,7 @@ public:
    void setDrawModifiers(const DrawModifiers& drawModifiers) { mDrawModifiers = drawModifiers; }

    ANDROID_API bool isCurrentTransformSimple() {
        return currentTransform().isSimple();
        return currentTransform()->isSimple();
    }

    Caches& getCaches() {
@@ -258,8 +254,8 @@ public:
        return mSnapshot->clipRegion->isEmpty();
    }

    int getViewportWidth() { return getSnapshot()->viewport.getWidth(); }
    int getViewportHeight() { return getSnapshot()->viewport.getHeight(); }
    int getViewportWidth() { return currentSnapshot()->viewport.getWidth(); }
    int getViewportHeight() { return currentSnapshot()->viewport.getHeight(); }

    /**
     * Scales the alpha on the current snapshot. This alpha value will be modulated
@@ -396,10 +392,6 @@ protected:
     */
    void dirtyLayerUnchecked(Rect& bounds, Region* region);

    sp<Snapshot> getSnapshot() const {
        return mSnapshot;
    }

    /**
     * Returns the region of the current layer.
     */
@@ -482,12 +474,11 @@ private:

    /**
     * Tells the GPU what part of the screen is about to be redrawn.
     * This method will use the clip rect that we started drawing the
     * frame with.
     * This method will use the current layer space clip rect.
     * This method needs to be invoked every time getTargetFbo() is
     * bound again.
     */
    void startTiling(const Snapshot& snapshot, bool opaque = false);
    void startTilingCurrentClip(bool opaque = false);

    /**
     * Tells the GPU what part of the screen is about to be redrawn.
@@ -988,9 +979,6 @@ private:
    // List of layers to update at the beginning of a frame
    Vector<Layer*> mLayerUpdates;

    // Indicates whether the clip must be restored
    bool mDirtyClip;

    // The following fields are used to setup drawing
    // Used to describe the shaders to generate
    ProgramDescription mDescription;
Loading