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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 314 } |
315 | 315 |
316 int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage( | 316 int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage( |
317 size_t width, | 317 size_t width, |
318 size_t height, | 318 size_t height, |
319 unsigned internalformat, | 319 unsigned internalformat, |
320 unsigned usage) { | 320 unsigned usage) { |
321 scoped_ptr<gfx::GpuMemoryBuffer> buffer(mus::MojoGpuMemoryBufferImpl::Create( | 321 scoped_ptr<gfx::GpuMemoryBuffer> buffer(mus::MojoGpuMemoryBufferImpl::Create( |
322 gfx::Size(static_cast<int>(width), static_cast<int>(height)), | 322 gfx::Size(static_cast<int>(width), static_cast<int>(height)), |
323 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), | 323 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), |
324 gfx::BufferUsage::GPU_READ_WRITE)); | 324 gfx::BufferUsage::SCANOUT)); |
325 if (!buffer) | 325 if (!buffer) |
326 return -1; | 326 return -1; |
327 | 327 |
328 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | 328 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); |
329 } | 329 } |
330 | 330 |
331 uint32_t CommandBufferClientImpl::InsertSyncPoint() { | 331 uint32_t CommandBufferClientImpl::InsertSyncPoint() { |
332 command_buffer_->InsertSyncPoint(true); | 332 command_buffer_->InsertSyncPoint(true); |
333 return sync_point_client_impl_->WaitForInsertSyncPoint(); | 333 return sync_point_client_impl_->WaitForInsertSyncPoint(); |
334 } | 334 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 // TODO(dyen) | 433 // TODO(dyen) |
434 } | 434 } |
435 | 435 |
436 bool CommandBufferClientImpl::CanWaitUnverifiedSyncToken( | 436 bool CommandBufferClientImpl::CanWaitUnverifiedSyncToken( |
437 const gpu::SyncToken* sync_token) { | 437 const gpu::SyncToken* sync_token) { |
438 // All sync tokens must be flushed before being waited on. | 438 // All sync tokens must be flushed before being waited on. |
439 return false; | 439 return false; |
440 } | 440 } |
441 | 441 |
442 } // namespace gles2 | 442 } // namespace gles2 |
OLD | NEW |