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 "services/ui/public/cpp/lib/command_buffer_client_impl.h" | 5 #include "services/ui/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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 ui::MojoGpuMemoryBufferImpl::Create( | 248 ui::MojoGpuMemoryBufferImpl::Create( |
249 gfx::Size(static_cast<int>(width), static_cast<int>(height)), | 249 gfx::Size(static_cast<int>(width), static_cast<int>(height)), |
250 gpu::DefaultBufferFormatForImageFormat(internalformat), | 250 gpu::DefaultBufferFormatForImageFormat(internalformat), |
251 gfx::BufferUsage::SCANOUT)); | 251 gfx::BufferUsage::SCANOUT)); |
252 if (!buffer) | 252 if (!buffer) |
253 return -1; | 253 return -1; |
254 | 254 |
255 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | 255 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); |
256 } | 256 } |
257 | 257 |
258 int32_t CommandBufferClientImpl::GetImageGpuMemoryBufferId(unsigned image_id) { | |
259 // TODO(erikchen): Once this class supports IOSurface GpuMemoryBuffer backed | |
260 // images, it will also need to keep a local cache from image id to | |
261 // GpuMemoryBuffer id. | |
262 NOTIMPLEMENTED(); | |
263 return -1; | |
264 } | |
265 | |
266 void CommandBufferClientImpl::SignalQuery(uint32_t query, | 258 void CommandBufferClientImpl::SignalQuery(uint32_t query, |
267 const base::Closure& callback) { | 259 const base::Closure& callback) { |
268 // TODO(piman) | 260 // TODO(piman) |
269 NOTIMPLEMENTED(); | 261 NOTIMPLEMENTED(); |
270 } | 262 } |
271 | 263 |
272 void CommandBufferClientImpl::Destroyed(int32_t lost_reason, int32_t error) { | 264 void CommandBufferClientImpl::Destroyed(int32_t lost_reason, int32_t error) { |
273 if (destroyed_) | 265 if (destroyed_) |
274 return; | 266 return; |
275 last_state_.context_lost_reason = | 267 last_state_.context_lost_reason = |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 353 |
362 // It is also safe to wait on the same context. | 354 // It is also safe to wait on the same context. |
363 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && | 355 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && |
364 sync_token->command_buffer_id() == GetCommandBufferID()) | 356 sync_token->command_buffer_id() == GetCommandBufferID()) |
365 return true; | 357 return true; |
366 | 358 |
367 return false; | 359 return false; |
368 } | 360 } |
369 | 361 |
370 } // namespace ui | 362 } // namespace ui |
OLD | NEW |