Commit 7de4ba61 authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

Force full restore on next MakeVirtuallyCurrent

This CL is kept minimal to facilitate merge to M72 (and potentially
M71).

Details on comments 14 and 15 on https://crbug.com/910274

A more complete solution addressing SkiaRenderer,SkDDL will come when
issue 902904 is resolved.

Bug: 910274
Change-Id: Ie0f44443fa30a5ec87045bd138a3a8a08e17e35c
Reviewed-on: https://chromium-review.googlesource.com/c/1358799Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Jonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613173}
parent 1d497322
......@@ -35,6 +35,7 @@ void GrCacheController::ScheduleGrContextCleanup() {
// a long while even if it is under budget. Below we set a call back to
// purge all possible GrContext resources if the context itself is not being
// used.
context_state_->context->DirtyVirtualContextState();
context_state_->need_context_state_reset = true;
context_state_->gr_context->performDeferredCleanup(
std::chrono::seconds(kOldResourceCleanupDelaySeconds));
......@@ -69,6 +70,7 @@ void GrCacheController::PurgeGrCache(uint64_t idle_id) {
return;
}
context_state_->context->DirtyVirtualContextState();
context_state_->need_context_state_reset = true;
context_state_->gr_context->freeGpuResources();
}
......
......@@ -188,6 +188,10 @@ void GLContext::ForceReleaseVirtuallyCurrent() {
NOTREACHED();
}
void GLContext::DirtyVirtualContextState() {
current_virtual_context_ = nullptr;
}
#if defined(OS_MACOSX)
uint64_t GLContext::BackpressureFenceCreate() {
return 0;
......
......@@ -194,6 +194,11 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// current.
virtual void ForceReleaseVirtuallyCurrent();
// Indicates that some GL state was modified that was not tracked by virtual
// contexts. Forces full reset from unknown state the next time a virtual
// context is made current.
void DirtyVirtualContextState();
#if defined(OS_MACOSX)
// Create a fence for all work submitted to this context so far, and return a
// monotonically increasing handle to it. This returned handle never needs to
......
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