Properly restore from image filter save layers.

SkCanvas::internalSaveLayer calls internalSetMatrix to smash the matrix.
SkCanvas::internalRestore tried to restore the state by setting just the
matrix on the canvas. However, this misses restoring the matrix on the
top devices. Correct this by making internalRestore mirror
internalSaveLayer and call internalSetMatrix.

Without this change some draw calls will not respect the matrix
correctly when they follow a draw with an image filter.

Change-Id: If2660cd3799c3050604d9d8754b140507ec3f5e1
Reviewed-on: https://skia-review.googlesource.com/123241
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2018-04-23 17:23:30 -04:00 committed by Skia Commit-Bot
parent 6f5e77a08f
commit 738a25645d

View File

@ -1130,7 +1130,7 @@ void SkCanvas::internalRestore() {
layer->fPaint.get(),
layer->fClipImage.get(), layer->fClipMatrix);
// restore what we smashed in internalSaveLayer
fMCRec->fMatrix = layer->fStashedMatrix;
this->internalSetMatrix(layer->fStashedMatrix);
// reset this, since internalDrawDevice will have set it to true
delete layer;
} else {