Fix order of matrix operations

When rasterzing with a non-zero left and top offset, we need to apply the scale
first so that we're translating in the correct coordinate system.

Fixes https://github.com/flutter/flutter/issues/1292
This commit is contained in:
Adam Barth
2016-01-19 09:57:26 -08:00
parent 9401907cc1
commit 0b66cb81fe

View File

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