Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: components/mus/gles2/command_buffer_local.cc

Issue 1864723003: Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: errorcallback: .get Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/mus/gles2/command_buffer_local.cc
diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc
index 23a8fd1e50fdae5a3e34160fa76ca384c2e2174e..ba2f12db9e02d033bc65ae26dba2898b3bf96ea7 100644
--- a/components/mus/gles2/command_buffer_local.cc
+++ b/components/mus/gles2/command_buffer_local.cc
@@ -16,6 +16,7 @@
#include "components/mus/gles2/gpu_state.h"
#include "components/mus/gles2/mojo_buffer_backing.h"
#include "components/mus/gles2/mojo_gpu_memory_buffer.h"
+#include "gpu/command_buffer/client/gpu_control_client.h"
#include "gpu/command_buffer/common/gpu_memory_buffer_support.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
@@ -76,10 +77,12 @@ CommandBufferLocal::CommandBufferLocal(CommandBufferLocalClient* client,
gpu_state_(gpu_state),
client_(client),
client_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
+ gpu_control_client_(nullptr),
next_transfer_buffer_id_(0),
next_image_id_(0),
next_fence_sync_release_(1),
flushed_fence_sync_release_(0),
+ lost_context_(false),
sync_point_client_waiter_(
gpu_state->sync_point_manager()->CreateSyncPointClientWaiter()),
weak_factory_(this) {
@@ -216,6 +219,10 @@ void CommandBufferLocal::DestroyTransferBuffer(int32_t id) {
base::Unretained(this), id));
}
+void CommandBufferLocal::SetGpuControlClient(gpu::GpuControlClient* client) {
+ gpu_control_client_ = client;
+}
+
gpu::Capabilities CommandBufferLocal::GetCapabilities() {
DCHECK(CalledOnValidThread());
return capabilities_;
@@ -541,8 +548,10 @@ bool CommandBufferLocal::SignalQueryOnGpuThread(uint32_t query_id,
}
void CommandBufferLocal::DidLoseContextOnClientThread(uint32_t reason) {
- if (client_)
- client_->DidLoseContext();
+ DCHECK(gpu_control_client_);
+ if (!lost_context_)
+ gpu_control_client_->OnGpuControlLostContext();
+ lost_context_ = true;
}
void CommandBufferLocal::UpdateVSyncParametersOnClientThread(int64_t timebase,

Powered by Google App Engine
This is Rietveld 408576698