diff options
Diffstat (limited to 'chromium/gpu/ipc/in_process_command_buffer.cc')
-rw-r--r-- | chromium/gpu/ipc/in_process_command_buffer.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chromium/gpu/ipc/in_process_command_buffer.cc b/chromium/gpu/ipc/in_process_command_buffer.cc index 4b98aab3ca3..08162a8e826 100644 --- a/chromium/gpu/ipc/in_process_command_buffer.cc +++ b/chromium/gpu/ipc/in_process_command_buffer.cc @@ -645,6 +645,11 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread( use_virtualized_gl_context_ ? gl_share_group_->GetSharedContext(surface_.get()) : nullptr; + if (real_context && + (!real_context->MakeCurrent(surface_.get()) || + real_context->CheckStickyGraphicsResetStatus() != GL_NO_ERROR)) { + real_context = nullptr; + } if (!real_context) { real_context = gl::init::CreateGLContext( gl_share_group_.get(), surface_.get(), @@ -680,7 +685,8 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread( if (!context_state_) { context_state_ = base::MakeRefCounted<SharedContextState>( gl_share_group_, surface_, real_context, - use_virtualized_gl_context_, base::DoNothing()); + use_virtualized_gl_context_, base::DoNothing(), + task_executor_->gpu_preferences().gr_context_type); context_state_->InitializeGL(task_executor_->gpu_preferences(), context_group_->feature_info()); context_state_->InitializeGrContext(workarounds, params.gr_shader_cache, @@ -1771,6 +1777,16 @@ viz::GpuVSyncCallback InProcessCommandBuffer::GetGpuVSyncCallback() { std::move(handle_gpu_vsync_callback)); } +base::TimeDelta InProcessCommandBuffer::GetGpuBlockedTimeSinceLastSwap() { + // Some examples and tests create InProcessCommandBuffer without + // GpuChannelManagerDelegate. + if (!gpu_channel_manager_delegate_) + return base::TimeDelta::Min(); + + return gpu_channel_manager_delegate_->GetGpuScheduler() + ->TakeTotalBlockingTime(); +} + void InProcessCommandBuffer::HandleGpuVSyncOnOriginThread( base::TimeTicks vsync_time, base::TimeDelta vsync_interval) { |