Stocks FAB "+" sometimes teleports to near the top left

The matrix argument to drawPicture doesn't seem to do what we want exactly.
Instead, use the normal matrix in the canvas. Also, handle cull rects with
non-zero left and top coordinates.

Fixes #1229
This commit is contained in:
Adam Barth 2016-01-13 12:31:03 -08:00
parent 4742f4ef6a
commit 6bb4c2374e

View File

@ -84,8 +84,9 @@ skia::RefPtr<SkImage> RasterCache::GetPrerolledImage(GrContext* context,
if (surface) {
SkCanvas* canvas = surface->getCanvas();
canvas->clear(SK_ColorTRANSPARENT);
SkMatrix matrix = SkMatrix::MakeScale(scaleX, scaleY);
canvas->drawPicture(picture, &matrix, nullptr);
canvas->translate(-rect.left(), -rect.right());
canvas->scale(scaleX, scaleY);
canvas->drawPicture(picture);
entry.image = skia::AdoptRef(surface->newImageSnapshot());
}
}