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

Unified Diff: mojo/gles2/command_buffer_client_impl.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: mojo/gles2/command_buffer_client_impl.cc
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc
index 14f0569ce1495c1f9ae994a8fdec6660abf305d6..5d778ab283992450bcf8cfc7fccca8432593cac8 100644
--- a/mojo/gles2/command_buffer_client_impl.cc
+++ b/mojo/gles2/command_buffer_client_impl.cc
@@ -16,6 +16,7 @@
#include "components/mus/gles2/command_buffer_type_conversions.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/command_buffer_id.h"
#include "gpu/command_buffer/common/gpu_memory_buffer_support.h"
#include "gpu/command_buffer/common/sync_token.h"
@@ -61,15 +62,11 @@ void InitializeCallback(mus::mojom::CommandBufferInitializeResultPtr* output,
} // namespace
-CommandBufferDelegate::~CommandBufferDelegate() {}
-
-void CommandBufferDelegate::ContextLost() {}
-
CommandBufferClientImpl::CommandBufferClientImpl(
- CommandBufferDelegate* delegate,
const std::vector<int32_t>& attribs,
mojo::ScopedMessagePipeHandle command_buffer_handle)
- : delegate_(delegate),
+ : gpu_control_client_(nullptr),
+ destroyed_(false),
attribs_(attribs),
client_binding_(this),
command_buffer_id_(),
@@ -203,6 +200,10 @@ void CommandBufferClientImpl::DestroyTransferBuffer(int32_t id) {
command_buffer_->DestroyTransferBuffer(id);
}
+void CommandBufferClientImpl::SetGpuControlClient(gpu::GpuControlClient* c) {
+ gpu_control_client_ = c;
+}
+
gpu::Capabilities CommandBufferClientImpl::GetCapabilities() {
return capabilities_;
}
@@ -285,10 +286,14 @@ void CommandBufferClientImpl::SignalQuery(uint32_t query,
}
void CommandBufferClientImpl::Destroyed(int32_t lost_reason, int32_t error) {
+ if (destroyed_)
+ return;
last_state_.context_lost_reason =
static_cast<gpu::error::ContextLostReason>(lost_reason);
last_state_.error = static_cast<gpu::error::Error>(error);
- delegate_->ContextLost();
+ DCHECK(gpu_control_client_);
piman 2016/04/11 21:54:26 Here too, allow it to be null?
+ gpu_control_client_->OnGpuControlLostContext();
+ destroyed_ = true;
}
void CommandBufferClientImpl::SignalAck(uint32_t id) {

Powered by Google App Engine
This is Rietveld 408576698