Call SkAutoCanvasRestore with doSave = true (flutter/engine#5432)

Although we do have a save before this SkAutoCanvasRestore so we
can theoretically send in doSave = false, it's safer to set doSave
to true to prevent future breakage.

As discussed with mtklein@google.com and reed@google.com, saving
canvas is very cheap in Skia so this should have no performance
impact. Skia is also considering remove doSave argument from
SkAutoCanvasRestore and always save the canvas.
This commit is contained in:
liyuqian
2018-05-31 16:41:58 -07:00
committed by GitHub
parent e471ead9f3
commit fe69e3eea1

View File

@@ -18,7 +18,7 @@
namespace flow {
void RasterCacheResult::draw(SkCanvas& canvas) const {
SkAutoCanvasRestore auto_restore(&canvas, false);
SkAutoCanvasRestore auto_restore(&canvas, true);
SkIRect bounds =
RasterCache::GetDeviceBounds(logical_rect_, canvas.getTotalMatrix());
FXL_DCHECK(bounds.size() == image_->dimensions());