Commit af66a78f authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

SkiaRenderer: fix the artifacts with Wayland and Ozone

The artifacts is because skia API is called in
SkiaOutputDeviceBufferQueue::PageFlipComplete. The Skia calls may
alter driver GL state which is not tracked by chrome GPU.
If use_virtualized_gl_contexts is used, WebGL and compositer are
sharing one platform GL context. since we cannot track GL state
changed by skia, so we cannot recover all GL state when switching
to virtualized GL context for WebGL. So it causes artifacts for
WebGL. Fix the problem by forcing a full GL state resetting.

Bug: 1053842
Change-Id: I14cd0f2fc389c93f6888ec5a422e1752e1e55ffe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094335Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748192}
parent d03d85b2
......@@ -374,8 +374,11 @@ void SkiaOutputDeviceBufferQueue::PageFlipComplete(Image* image) {
available_images_.push_back(displayed_image_);
// Call BeginWriteSkia() for the next frame here to avoid some expensive
// operations on the critical code path.
auto shared_context_state = dependency_->GetSharedContextState();
if (!available_images_.front()->sk_surface() &&
dependency_->GetSharedContextState()->MakeCurrent(nullptr)) {
shared_context_state->MakeCurrent(nullptr)) {
// BeginWriteSkia() may alter GL's state.
shared_context_state->set_need_context_state_reset(true);
available_images_.front()->BeginWriteSkia();
}
}
......
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