Commit 233f0e4e authored by Aaron Krajeski's avatar Aaron Krajeski Committed by Commit Bot

Don't save with lost context

Because we don't return the skia canvas when the context is lost we can
invalidate the save stack if we save on our end. This is testable
(https://bugs.chromium.org/p/chromium/issues/detail?id=1035224) but only
with the --enable-experimental-web-platform-features flag.

Bug: 1035224
Change-Id: I0048dc5c9e26908b5568173aa6431adc11a013b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2002929
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Reviewed-by: default avatarAaron Krajeski <aaronhk@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Reviewed-by: default avatarJuanmi Huertas <juanmihd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733439}
parent f5d6eaf4
......@@ -69,11 +69,15 @@ void BaseRenderingContext2D::RealizeSaves() {
}
void BaseRenderingContext2D::save() {
if (isContextLost())
return;
state_stack_.back()->Save();
ValidateStateStack();
}
void BaseRenderingContext2D::restore() {
if (isContextLost())
return;
ValidateStateStack();
if (GetState().HasUnrealizedSaves()) {
// We never realized the save, so just record that it was unnecessary.
......
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