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

Commit 4ace7305 authored by Chris Craik's avatar Chris Craik
Browse files

Force isolation of clip and matrix within layer

bug:17379260

Unclipped save layers need to isolate their clips and matrices
so that the save time readout of background content matches clip and
position with the restore/compose step.

Change-Id: I2de474cda76e960d080852f1716d6ddfa8a512d4
parent db352c78
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,9 @@ void DisplayListRenderer::restoreToCount(int saveCount) {


int DisplayListRenderer::saveLayer(float left, float top, float right, float bottom,
int DisplayListRenderer::saveLayer(float left, float top, float right, float bottom,
        const SkPaint* paint, int flags) {
        const SkPaint* paint, int flags) {
    // force matrix/clip isolation for layer
    flags |= SkCanvas::kClip_SaveFlag | SkCanvas::kMatrix_SaveFlag;

    paint = refPaint(paint);
    paint = refPaint(paint);
    addStateOp(new (alloc()) SaveLayerOp(left, top, right, bottom, paint, flags));
    addStateOp(new (alloc()) SaveLayerOp(left, top, right, bottom, paint, flags));
    return StatefulBaseRenderer::save(flags);
    return StatefulBaseRenderer::save(flags);
+3 −0
Original line number Original line Diff line number Diff line
@@ -638,6 +638,9 @@ void OpenGLRenderer::onSnapshotRestored(const Snapshot& removed, const Snapshot&


int OpenGLRenderer::saveLayer(float left, float top, float right, float bottom,
int OpenGLRenderer::saveLayer(float left, float top, float right, float bottom,
        const SkPaint* paint, int flags, const SkPath* convexMask) {
        const SkPaint* paint, int flags, const SkPath* convexMask) {
    // force matrix/clip isolation for layer
    flags |= SkCanvas::kClip_SaveFlag | SkCanvas::kMatrix_SaveFlag;

    const int count = saveSnapshot(flags);
    const int count = saveSnapshot(flags);


    if (!currentSnapshot()->isIgnored()) {
    if (!currentSnapshot()->isIgnored()) {