| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |