From 17ed6993976aa11a54ac4c1af77fc4020b57eb44 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 --- flow/raster_cache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 6ced53d6afc..08e5b076d6e 100644 --- a/flow/raster_cache.cc +++ b/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()); } }