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

Set need need_context_state_reset when GrContext accessed

When we access RasterDecoderContextState::gr_context, the
RasterDecoderImpl::context_state may become inconsistent with
actual GL context state and we should set need_context_state_reset

Bug: 910274
Change-Id: I834ce6e4cf9b5fe549de432b3bc6c06fa2a6ccbd
Reviewed-on: https://chromium-review.googlesource.com/c/1355438
Commit-Queue: Jonathan Backer <backer@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612332}
parent 768fdd5c
...@@ -559,6 +559,7 @@ bool SkiaOutputSurfaceImplOnGpu::MakeCurrent() { ...@@ -559,6 +559,7 @@ bool SkiaOutputSurfaceImplOnGpu::MakeCurrent() {
context_lost_callback_.Run(); context_lost_callback_.Run();
return false; return false;
} }
context_state_->need_context_state_reset = true;
} }
return true; return true;
} }
......
...@@ -35,6 +35,7 @@ void GrCacheController::ScheduleGrContextCleanup() { ...@@ -35,6 +35,7 @@ void GrCacheController::ScheduleGrContextCleanup() {
// a long while even if it is under budget. Below we set a call back to // 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 // purge all possible GrContext resources if the context itself is not being
// used. // used.
context_state_->need_context_state_reset = true;
context_state_->gr_context->performDeferredCleanup( context_state_->gr_context->performDeferredCleanup(
std::chrono::seconds(kOldResourceCleanupDelaySeconds)); std::chrono::seconds(kOldResourceCleanupDelaySeconds));
...@@ -68,6 +69,7 @@ void GrCacheController::PurgeGrCache(uint64_t idle_id) { ...@@ -68,6 +69,7 @@ void GrCacheController::PurgeGrCache(uint64_t idle_id) {
return; return;
} }
context_state_->need_context_state_reset = true;
context_state_->gr_context->freeGpuResources(); context_state_->gr_context->freeGpuResources();
} }
......
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