| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage( | 246 int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage( |
| 247 size_t width, | 247 size_t width, |
| 248 size_t height, | 248 size_t height, |
| 249 unsigned internalformat, | 249 unsigned internalformat, |
| 250 unsigned usage) { | 250 unsigned usage) { |
| 251 // TODO(piman) | 251 // TODO(piman) |
| 252 NOTIMPLEMENTED(); | 252 NOTIMPLEMENTED(); |
| 253 return -1; | 253 return -1; |
| 254 } | 254 } |
| 255 | 255 |
| 256 uint32 CommandBufferClientImpl::InsertSyncPoint() { | 256 uint32_t CommandBufferClientImpl::InsertSyncPoint() { |
| 257 command_buffer_->InsertSyncPoint(); | 257 command_buffer_->InsertSyncPoint(true); |
| 258 return sync_point_client_impl_->WaitForInsertSyncPoint(); | 258 return sync_point_client_impl_->WaitForInsertSyncPoint(); |
| 259 } | 259 } |
| 260 | 260 |
| 261 uint32 CommandBufferClientImpl::InsertFutureSyncPoint() { | 261 uint32_t CommandBufferClientImpl::InsertFutureSyncPoint() { |
| 262 // TODO(abarth): I'm not sure this implementation is correct. Don't we need | 262 command_buffer_->InsertSyncPoint(false); |
| 263 // to wait until RetireSyncPoint is called to retire the sync point? Otherwise | |
| 264 // it seems like we won't know whether the commands inserted between now and | |
| 265 // RetireSyncPoint will have bee processed by the server. | |
| 266 command_buffer_->InsertSyncPoint(); | |
| 267 return sync_point_client_impl_->WaitForInsertSyncPoint(); | 263 return sync_point_client_impl_->WaitForInsertSyncPoint(); |
| 268 } | 264 } |
| 269 | 265 |
| 270 void CommandBufferClientImpl::RetireSyncPoint(uint32 sync_point) { | 266 void CommandBufferClientImpl::RetireSyncPoint(uint32_t sync_point) { |
| 271 // TODO(piman) | 267 command_buffer_->RetireSyncPoint(sync_point); |
| 272 NOTIMPLEMENTED(); | |
| 273 } | 268 } |
| 274 | 269 |
| 275 void CommandBufferClientImpl::SignalSyncPoint(uint32 sync_point, | 270 void CommandBufferClientImpl::SignalSyncPoint(uint32_t sync_point, |
| 276 const base::Closure& callback) { | 271 const base::Closure& callback) { |
| 277 // TODO(piman) | 272 // TODO(piman) |
| 278 } | 273 } |
| 279 | 274 |
| 280 void CommandBufferClientImpl::SignalQuery(uint32 query, | 275 void CommandBufferClientImpl::SignalQuery(uint32_t query, |
| 281 const base::Closure& callback) { | 276 const base::Closure& callback) { |
| 282 // TODO(piman) | 277 // TODO(piman) |
| 283 NOTIMPLEMENTED(); | 278 NOTIMPLEMENTED(); |
| 284 } | 279 } |
| 285 | 280 |
| 286 void CommandBufferClientImpl::SetSurfaceVisible(bool visible) { | 281 void CommandBufferClientImpl::SetSurfaceVisible(bool visible) { |
| 287 // TODO(piman) | 282 // TODO(piman) |
| 288 NOTIMPLEMENTED(); | 283 NOTIMPLEMENTED(); |
| 289 } | 284 } |
| 290 | 285 |
| 291 uint32 CommandBufferClientImpl::CreateStreamTexture(uint32 texture_id) { | 286 uint32_t CommandBufferClientImpl::CreateStreamTexture(uint32_t texture_id) { |
| 292 // TODO(piman) | 287 // TODO(piman) |
| 293 NOTIMPLEMENTED(); | 288 NOTIMPLEMENTED(); |
| 294 return 0; | 289 return 0; |
| 295 } | 290 } |
| 296 | 291 |
| 297 void CommandBufferClientImpl::DidDestroy() { | 292 void CommandBufferClientImpl::DidDestroy() { |
| 298 LostContext(gpu::error::kUnknown); | 293 LostContext(gpu::error::kUnknown); |
| 299 } | 294 } |
| 300 | 295 |
| 301 void CommandBufferClientImpl::LostContext(int32_t lost_reason) { | 296 void CommandBufferClientImpl::LostContext(int32_t lost_reason) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 324 DidDestroy(); | 319 DidDestroy(); |
| 325 return; | 320 return; |
| 326 } | 321 } |
| 327 | 322 |
| 328 if (state->generation - last_state_.generation < 0x80000000U) | 323 if (state->generation - last_state_.generation < 0x80000000U) |
| 329 last_state_ = state.To<State>(); | 324 last_state_ = state.To<State>(); |
| 330 } | 325 } |
| 331 | 326 |
| 332 } // namespace gles2 | 327 } // namespace gles2 |
| 333 } // namespace mojo | 328 } // namespace mojo |
| OLD | NEW |