| 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 "components/mus/public/cpp/lib/command_buffer_client_impl.h" | 5 #include "components/mus/public/cpp/lib/command_buffer_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 mus::MojoGpuMemoryBufferImpl::Create( | 264 mus::MojoGpuMemoryBufferImpl::Create( |
| 265 gfx::Size(static_cast<int>(width), static_cast<int>(height)), | 265 gfx::Size(static_cast<int>(width), static_cast<int>(height)), |
| 266 gpu::DefaultBufferFormatForImageFormat(internalformat), | 266 gpu::DefaultBufferFormatForImageFormat(internalformat), |
| 267 gfx::BufferUsage::SCANOUT)); | 267 gfx::BufferUsage::SCANOUT)); |
| 268 if (!buffer) | 268 if (!buffer) |
| 269 return -1; | 269 return -1; |
| 270 | 270 |
| 271 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | 271 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); |
| 272 } | 272 } |
| 273 | 273 |
| 274 int32_t CommandBufferClientImpl::GetImageGpuMemoryBufferId(unsigned image_id) { |
| 275 // TODO(erikchen): Once this class supports IOSurface GpuMemoryBuffer backed |
| 276 // images, it will also need to keep a local cache from image id to |
| 277 // GpuMemoryBuffer id. |
| 278 NOTIMPLEMENTED(); |
| 279 return -1; |
| 280 } |
| 281 |
| 274 void CommandBufferClientImpl::SignalQuery(uint32_t query, | 282 void CommandBufferClientImpl::SignalQuery(uint32_t query, |
| 275 const base::Closure& callback) { | 283 const base::Closure& callback) { |
| 276 // TODO(piman) | 284 // TODO(piman) |
| 277 NOTIMPLEMENTED(); | 285 NOTIMPLEMENTED(); |
| 278 } | 286 } |
| 279 | 287 |
| 280 void CommandBufferClientImpl::Destroyed(int32_t lost_reason, int32_t error) { | 288 void CommandBufferClientImpl::Destroyed(int32_t lost_reason, int32_t error) { |
| 281 if (destroyed_) | 289 if (destroyed_) |
| 282 return; | 290 return; |
| 283 last_state_.context_lost_reason = | 291 last_state_.context_lost_reason = |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 377 |
| 370 // It is also safe to wait on the same context. | 378 // It is also safe to wait on the same context. |
| 371 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && | 379 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && |
| 372 sync_token->command_buffer_id() == GetCommandBufferID()) | 380 sync_token->command_buffer_id() == GetCommandBufferID()) |
| 373 return true; | 381 return true; |
| 374 | 382 |
| 375 return false; | 383 return false; |
| 376 } | 384 } |
| 377 | 385 |
| 378 } // namespace mus | 386 } // namespace mus |
| OLD | NEW |