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

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

Issue 384513003: Remove RequestAnimationFrame from mojo, add delayed tasks to RunLoop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 void CommandBufferImpl::DestroyTransferBuffer(int32_t id) { 165 void CommandBufferImpl::DestroyTransferBuffer(int32_t id) {
166 command_buffer_->DestroyTransferBuffer(id); 166 command_buffer_->DestroyTransferBuffer(id);
167 } 167 }
168 168
169 void CommandBufferImpl::Echo(const Callback<void()>& callback) { 169 void CommandBufferImpl::Echo(const Callback<void()>& callback) {
170 callback.Run(); 170 callback.Run();
171 } 171 }
172 172
173 void CommandBufferImpl::RequestAnimationFrames() {
174 timer_.Start(FROM_HERE,
175 base::TimeDelta::FromMilliseconds(16),
176 this,
177 &CommandBufferImpl::DrawAnimationFrame);
178 }
179
180 void CommandBufferImpl::CancelAnimationFrames() { timer_.Stop(); }
181
182 void CommandBufferImpl::OnParseError() { 173 void CommandBufferImpl::OnParseError() {
183 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); 174 gpu::CommandBuffer::State state = command_buffer_->GetLastState();
184 client()->LostContext(state.context_lost_reason); 175 client()->LostContext(state.context_lost_reason);
185 } 176 }
186 177
187 void CommandBufferImpl::DrawAnimationFrame() { client()->DrawAnimationFrame(); }
188
189 void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) { 178 void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) {
190 surface_->Resize(size); 179 surface_->Resize(size);
191 } 180 }
192 181
193 } // namespace services 182 } // namespace services
194 } // namespace mojo 183 } // namespace mojo
OLDNEW
« mojo/examples/sample_app/gles2_client_impl.cc ('K') | « 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