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

Side by Side Diff: mojo/services/gles2/command_buffer_impl.cc

Issue 198343002: Mojo: request/response bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/services/gles2/command_buffer_impl.h" 5 #include "mojo/services/gles2/command_buffer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 9
10 #include "gpu/command_buffer/common/constants.h" 10 #include "gpu/command_buffer/common/constants.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 uint32_t size) { 145 uint32_t size) {
146 bool read_only = false; 146 bool read_only = false;
147 base::SharedMemory shared_memory(transfer_buffer, read_only); 147 base::SharedMemory shared_memory(transfer_buffer, read_only);
148 command_buffer_->RegisterTransferBuffer(id, &shared_memory, size); 148 command_buffer_->RegisterTransferBuffer(id, &shared_memory, size);
149 } 149 }
150 150
151 void CommandBufferImpl::DestroyTransferBuffer(int32_t id) { 151 void CommandBufferImpl::DestroyTransferBuffer(int32_t id) {
152 command_buffer_->DestroyTransferBuffer(id); 152 command_buffer_->DestroyTransferBuffer(id);
153 } 153 }
154 154
155 void CommandBufferImpl::Echo() { client_->EchoAck(); } 155 void CommandBufferImpl::Echo(const Callback<void()>& callback) {
156 callback.Run();
157 }
156 158
157 void CommandBufferImpl::RequestAnimationFrames() { 159 void CommandBufferImpl::RequestAnimationFrames() {
158 timer_.Start(FROM_HERE, 160 timer_.Start(FROM_HERE,
159 base::TimeDelta::FromMilliseconds(16), 161 base::TimeDelta::FromMilliseconds(16),
160 this, 162 this,
161 &CommandBufferImpl::DrawAnimationFrame); 163 &CommandBufferImpl::DrawAnimationFrame);
162 } 164 }
163 165
164 void CommandBufferImpl::CancelAnimationFrames() { timer_.Stop(); } 166 void CommandBufferImpl::CancelAnimationFrames() { timer_.Stop(); }
165 167
166 void CommandBufferImpl::OnParseError() { 168 void CommandBufferImpl::OnParseError() {
167 gpu::CommandBuffer::State state = command_buffer_->GetState(); 169 gpu::CommandBuffer::State state = command_buffer_->GetState();
168 client_->LostContext(state.context_lost_reason); 170 client_->LostContext(state.context_lost_reason);
169 } 171 }
170 172
171 void CommandBufferImpl::DrawAnimationFrame() { client_->DrawAnimationFrame(); } 173 void CommandBufferImpl::DrawAnimationFrame() { client_->DrawAnimationFrame(); }
172 174
173 } // namespace services 175 } // namespace services
174 } // namespace mojo 176 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698