Commit 715abf43 authored by Vasiliy Telezhnikov's avatar Vasiliy Telezhnikov Committed by Commit Bot

Stop writing in dtor in SkiaRenderer BufferQueue.

After BeginWrite was moved out of critical path
SkiaOutputDeviceBufferQueue::Image is often in the middle of write.
When resize or reallocation of display happen (e.g rotate screen on
Android) we need to call EndWrite on the image before destruction to
ensure all necessary semaphores are submitted.

Bug: 1056221
Change-Id: Id55c25f43cbb4bf082ad3e3ef6cd1b59e164937d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083835
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746438}
parent 2e7bff26
......@@ -43,7 +43,14 @@ class SkiaOutputDeviceBufferQueue::Image {
Image(gpu::SharedImageFactory* factory,
gpu::SharedImageRepresentationFactory* representation_factory)
: factory_(factory), representation_factory_(representation_factory) {}
~Image() = default;
~Image() {
// TODO(vasilyt): As we are going to delete image anyway we should be able
// to abort write to avoid unnecessary flush to submit semaphores.
if (scoped_skia_write_access_) {
EndWriteSkia();
}
DCHECK(!scoped_skia_write_access_);
}
bool Initialize(const gfx::Size& size,
const gfx::ColorSpace& color_space,
......
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