| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gles2/command_buffer_client_impl.h" | 5 #include "mojo/gles2/command_buffer_client_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 NOTIMPLEMENTED(); | 209 NOTIMPLEMENTED(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void CommandBufferClientImpl::SendManagedMemoryStats( | 212 void CommandBufferClientImpl::SendManagedMemoryStats( |
| 213 const gpu::ManagedMemoryStats& stats) { | 213 const gpu::ManagedMemoryStats& stats) { |
| 214 // TODO(piman) | 214 // TODO(piman) |
| 215 NOTIMPLEMENTED(); | 215 NOTIMPLEMENTED(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void CommandBufferClientImpl::Echo(const base::Closure& callback) { | 218 void CommandBufferClientImpl::Echo(const base::Closure& callback) { |
| 219 echo_closures_.push(callback); | 219 command_buffer_->Echo(callback); |
| 220 command_buffer_->Echo(); | |
| 221 } | 220 } |
| 222 | 221 |
| 223 uint32 CommandBufferClientImpl::CreateStreamTexture(uint32 texture_id) { | 222 uint32 CommandBufferClientImpl::CreateStreamTexture(uint32 texture_id) { |
| 224 // TODO(piman) | 223 // TODO(piman) |
| 225 NOTIMPLEMENTED(); | 224 NOTIMPLEMENTED(); |
| 226 return 0; | 225 return 0; |
| 227 } | 226 } |
| 228 | 227 |
| 229 void CommandBufferClientImpl::RequestAnimationFrames() { | 228 void CommandBufferClientImpl::RequestAnimationFrames() { |
| 230 command_buffer_->RequestAnimationFrames(); | 229 command_buffer_->RequestAnimationFrames(); |
| 231 } | 230 } |
| 232 | 231 |
| 233 void CommandBufferClientImpl::CancelAnimationFrames() { | 232 void CommandBufferClientImpl::CancelAnimationFrames() { |
| 234 command_buffer_->CancelAnimationFrames(); | 233 command_buffer_->CancelAnimationFrames(); |
| 235 } | 234 } |
| 236 | 235 |
| 237 void CommandBufferClientImpl::DidInitialize(bool success) { | 236 void CommandBufferClientImpl::DidInitialize(bool success) { |
| 238 initialize_result_ = success; | 237 initialize_result_ = success; |
| 239 } | 238 } |
| 240 | 239 |
| 241 void CommandBufferClientImpl::DidMakeProgress(const CommandBufferState& state) { | 240 void CommandBufferClientImpl::DidMakeProgress(const CommandBufferState& state) { |
| 242 if (state.generation() - last_state_.generation < 0x80000000U) | 241 if (state.generation() - last_state_.generation < 0x80000000U) |
| 243 last_state_ = state; | 242 last_state_ = state; |
| 244 } | 243 } |
| 245 | 244 |
| 246 void CommandBufferClientImpl::DidDestroy() { | 245 void CommandBufferClientImpl::DidDestroy() { |
| 247 LostContext(gpu::error::kUnknown); | 246 LostContext(gpu::error::kUnknown); |
| 248 } | 247 } |
| 249 | 248 |
| 250 void CommandBufferClientImpl::EchoAck() { | |
| 251 base::Closure closure = echo_closures_.front(); | |
| 252 echo_closures_.pop(); | |
| 253 closure.Run(); | |
| 254 } | |
| 255 | |
| 256 void CommandBufferClientImpl::LostContext(int32_t lost_reason) { | 249 void CommandBufferClientImpl::LostContext(int32_t lost_reason) { |
| 257 last_state_.error = gpu::error::kLostContext; | 250 last_state_.error = gpu::error::kLostContext; |
| 258 last_state_.context_lost_reason = | 251 last_state_.context_lost_reason = |
| 259 static_cast<gpu::error::ContextLostReason>(lost_reason); | 252 static_cast<gpu::error::ContextLostReason>(lost_reason); |
| 260 delegate_->ContextLost(); | 253 delegate_->ContextLost(); |
| 261 } | 254 } |
| 262 | 255 |
| 263 void CommandBufferClientImpl::OnError() { LostContext(gpu::error::kUnknown); } | 256 void CommandBufferClientImpl::OnError() { LostContext(gpu::error::kUnknown); } |
| 264 | 257 |
| 265 void CommandBufferClientImpl::TryUpdateState() { | 258 void CommandBufferClientImpl::TryUpdateState() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 276 return; | 269 return; |
| 277 } | 270 } |
| 278 } | 271 } |
| 279 | 272 |
| 280 void CommandBufferClientImpl::DrawAnimationFrame() { | 273 void CommandBufferClientImpl::DrawAnimationFrame() { |
| 281 delegate_->DrawAnimationFrame(); | 274 delegate_->DrawAnimationFrame(); |
| 282 } | 275 } |
| 283 | 276 |
| 284 } // namespace gles2 | 277 } // namespace gles2 |
| 285 } // namespace mojo | 278 } // namespace mojo |
| OLD | NEW |