Commit f5d6f79d authored by Aaron Krajeski's avatar Aaron Krajeski Committed by Chromium LUCI CQ

Make reset actually clear the backing buffer

This only should happen if the paint canvas exists so that it doesn't
wipe out the buffer in the situation when the context is lost.

Bug: 1131449, 1131137
Change-Id: I355de75bc92e41e8d2224bf4ecd4e9104b94a67b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2633345
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844597}
parent d5a7000f
...@@ -184,6 +184,9 @@ void BaseRenderingContext2D::reset() { ...@@ -184,6 +184,9 @@ void BaseRenderingContext2D::reset() {
DCHECK(c->getDeviceClipBounds(&clip_bounds)); DCHECK(c->getDeviceClipBounds(&clip_bounds));
DCHECK(clip_bounds == c->imageInfo().bounds()); DCHECK(clip_bounds == c->imageInfo().bounds());
#endif #endif
// We only want to clear the backing buffer if the surface exists because
// this function is also used when the context is lost.
clearRect(0, 0, Width(), Height());
} }
ValidateStateStack(); ValidateStateStack();
origin_tainted_by_content_ = false; origin_tainted_by_content_ = false;
......
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