Replace |have_recorded_draw_commands_| in OffscreenCanvasRenderingContext2D
The cause of this bug was the switch to a RecordPaintCanvas() on the CanvasResourceProvider. Previously, a Clear Operation was done directly on the skia canvas in OffscreenCanvas::GetOrCreateResourceProvider(). Now that CanvasResourceProvider::Canvas() returns a RecordPaintCanvas(), a Clear Op is recorded, but not drawn to the backing skia canvas until flush. The context's tracking boolean, |have_recorded_draw_commands_|, was not updated to signal that a flush was needed. This resulted in WritePixels()'s call to FlushRecording() earlying out with no flush, despite the existence of draw operations. By replacing |have_recorded_draw_commands_| with a check of the recorder's actual DisplayItemList, we can avoid juggling the |have_recorded_draw_commands_| boolean and can always correctly determine if a flush is necessary. Bug: 1059121 Change-Id: Ic511229a0cdb0ef3fe48dbd4d760066a0be2d10c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099299Reviewed-by:Aaron Krajeski <aaronhk@chromium.org> Reviewed-by:
Fernando Serboncini <fserb@chromium.org> Reviewed-by:
Khushal <khushalsagar@chromium.org> Commit-Queue: Jonah Chin <jochin@microsoft.com> Cr-Commit-Position: refs/heads/master@{#751090}
Showing
Please register or sign in to comment