From ac830431738ea7c44d0703d5e0a48cd286a3daab Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 19 Jan 2016 09:57:26 -0800 Subject: [PATCH] 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 --- flow/raster_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 0d70fb102..4a2b71f34 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -84,8 +84,8 @@ skia::RefPtr 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()); } -- GitLab