From 6bb4c2374e38ad0a08e72c9513ff0befce4c51bb Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 13 Jan 2016 12:31:03 -0800 Subject: [PATCH] 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 --- engine/src/flutter/flow/raster_cache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/flow/raster_cache.cc b/engine/src/flutter/flow/raster_cache.cc index 6ced53d6afc..08e5b076d6e 100644 --- a/engine/src/flutter/flow/raster_cache.cc +++ b/engine/src/flutter/flow/raster_cache.cc @@ -84,8 +84,9 @@ skia::RefPtr 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()); } }