OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/gpu/client/command_buffer_proxy_impl.h" | 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 int32_t CommandBufferProxyImpl::CreateGpuMemoryBufferImage( | 455 int32_t CommandBufferProxyImpl::CreateGpuMemoryBufferImage( |
456 size_t width, | 456 size_t width, |
457 size_t height, | 457 size_t height, |
458 unsigned internalformat, | 458 unsigned internalformat, |
459 unsigned usage) { | 459 unsigned usage) { |
460 CheckLock(); | 460 CheckLock(); |
461 scoped_ptr<gfx::GpuMemoryBuffer> buffer( | 461 scoped_ptr<gfx::GpuMemoryBuffer> buffer( |
462 channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( | 462 channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( |
463 gfx::Size(width, height), | 463 gfx::Size(width, height), |
464 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), | 464 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), |
465 gfx::BufferUsage::GPU_READ_WRITE)); | 465 gfx::BufferUsage::SCANOUT)); |
466 if (!buffer) | 466 if (!buffer) |
467 return -1; | 467 return -1; |
468 | 468 |
469 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | 469 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); |
470 } | 470 } |
471 | 471 |
472 uint32 CommandBufferProxyImpl::CreateStreamTexture(uint32 texture_id) { | 472 uint32 CommandBufferProxyImpl::CreateStreamTexture(uint32 texture_id) { |
473 CheckLock(); | 473 CheckLock(); |
474 if (last_state_.error != gpu::error::kNoError) | 474 if (last_state_.error != gpu::error::kNoError) |
475 return 0; | 475 return 0; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 } | 738 } |
739 } | 739 } |
740 | 740 |
741 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 741 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
742 base::TimeDelta interval) { | 742 base::TimeDelta interval) { |
743 if (!update_vsync_parameters_completion_callback_.is_null()) | 743 if (!update_vsync_parameters_completion_callback_.is_null()) |
744 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 744 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
745 } | 745 } |
746 | 746 |
747 } // namespace content | 747 } // namespace content |
OLD | NEW |