Commit 377717ee authored by Khushal Sagar's avatar Khushal Sagar Committed by Commit Bot

blink/canvas: Fix incorrect lifetime assumptions for context loss.

After the change in [1], we no longer ensure that the SkCanvas lifetime
is tied to CanvasImageProvider.

[1] : https://chromium-review.googlesource.com/c/chromium/src/+/2450842

R=aaronhk@chromium.org

Bug: 1143229
Change-Id: If99ff121c221b6560da58596fc9faf11fe28dfeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2528615
Auto-Submit: Khushal <khushalsagar@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Reviewed-by: default avatarJuanmi Huertas <juanmihd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825815}
parent e5c27ecb
...@@ -1155,14 +1155,9 @@ cc::PaintCanvas* CanvasResourceProvider::Canvas() { ...@@ -1155,14 +1155,9 @@ cc::PaintCanvas* CanvasResourceProvider::Canvas() {
} }
void CanvasResourceProvider::OnContextDestroyed() { void CanvasResourceProvider::OnContextDestroyed() {
if (canvas_image_provider_) { if (skia_canvas_)
if (!UseOopRasterization()) { skia_canvas_->reset_image_provider();
DCHECK(skia_canvas_); canvas_image_provider_.reset();
skia_canvas_->reset_image_provider();
}
canvas_image_provider_.reset();
}
} }
void CanvasResourceProvider::OnFlushForImage(PaintImage::ContentId content_id) { void CanvasResourceProvider::OnFlushForImage(PaintImage::ContentId content_id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment