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

Unified Diff: mojo/gles2/command_buffer_client_impl.cc

Issue 1686543004: mus: Modify mojo command buffer to match current chrome gpu ipc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review issues Created 4 years, 10 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
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cbf9b3ea08920c533ec7d7d73704f56c41a02e92..5000bce210bdf42df47c9670862c27b985838983 100644
--- a/mojo/gles2/command_buffer_client_impl.cc
+++ b/mojo/gles2/command_buffer_client_impl.cc
@@ -71,7 +71,7 @@ CommandBufferClientImpl::CommandBufferClientImpl(
mojo::ScopedMessagePipeHandle command_buffer_handle)
: delegate_(delegate),
attribs_(attribs),
- observer_binding_(this),
+ client_binding_(this),
command_buffer_id_(0),
shared_state_(NULL),
last_put_offset_(-1),
@@ -84,7 +84,7 @@ CommandBufferClientImpl::CommandBufferClientImpl(
std::move(command_buffer_handle), 0u),
async_waiter);
command_buffer_.set_connection_error_handler(
- [this]() { DidLoseContext(gpu::error::kUnknown); });
+ [this]() { Destroyed(gpu::error::kUnknown, gpu::error::kLostContext); });
}
CommandBufferClientImpl::~CommandBufferClientImpl() {}
@@ -102,12 +102,12 @@ bool CommandBufferClientImpl::Initialize() {
shared_state()->Initialize();
- mus::mojom::CommandBufferLostContextObserverPtr observer_ptr;
- observer_binding_.Bind(GetProxy(&observer_ptr), async_waiter_);
+ mus::mojom::CommandBufferClientPtr client_ptr;
+ client_binding_.Bind(GetProxy(&client_ptr), async_waiter_);
mus::mojom::CommandBufferInitializeResultPtr initialize_result;
command_buffer_->Initialize(
- std::move(observer_ptr), std::move(duped),
+ std::move(client_ptr), std::move(duped),
mojo::Array<int32_t>::From(attribs_),
base::Bind(&InitializeCallback, &initialize_result));
@@ -285,13 +285,27 @@ void CommandBufferClientImpl::SignalQuery(uint32_t query,
NOTIMPLEMENTED();
}
-void CommandBufferClientImpl::DidLoseContext(int32_t lost_reason) {
- last_state_.error = gpu::error::kLostContext;
+void CommandBufferClientImpl::Destroyed(int32_t lost_reason, int32_t error) {
last_state_.context_lost_reason =
static_cast<gpu::error::ContextLostReason>(lost_reason);
+ last_state_.error = static_cast<gpu::error::Error>(error);
delegate_->ContextLost();
}
+void CommandBufferClientImpl::SignalAck(uint32_t id) {
+}
+
+void CommandBufferClientImpl::SwapBuffersCompleted(int32_t result) {
+}
+
+void CommandBufferClientImpl::UpdateState(
+ const gpu::CommandBuffer::State& state) {
+}
+
+void CommandBufferClientImpl::UpdateVSyncParameters(int64_t timebase,
+ int64_t interval) {
+}
+
void CommandBufferClientImpl::TryUpdateState() {
if (last_state_.error == gpu::error::kNoError)
shared_state()->Read(&last_state_);
@@ -307,7 +321,7 @@ void CommandBufferClientImpl::MakeProgressAndUpdateState() {
if (!command_buffer_.WaitForIncomingResponse()) {
VLOG(1) << "Channel encountered error while waiting for command buffer.";
// TODO(piman): is it ok for this to re-enter?
- DidLoseContext(gpu::error::kUnknown);
+ Destroyed(gpu::error::kUnknown, gpu::error::kLostContext);
return;
}
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698