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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 DCHECK(gpu_memory_buffer); | 366 DCHECK(gpu_memory_buffer); |
367 | 367 |
368 // This handle is owned by the GPU process and must be passed to it or it | 368 // This handle is owned by the GPU process and must be passed to it or it |
369 // will leak. In otherwords, do not early out on error between here and the | 369 // will leak. In otherwords, do not early out on error between here and the |
370 // sending of the CreateImage IPC below. | 370 // sending of the CreateImage IPC below. |
371 bool requires_sync_point = false; | 371 bool requires_sync_point = false; |
372 gfx::GpuMemoryBufferHandle handle = | 372 gfx::GpuMemoryBufferHandle handle = |
373 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(), | 373 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(), |
374 &requires_sync_point); | 374 &requires_sync_point); |
375 | 375 |
| 376 DCHECK(gpu::ImageFactory::IsGpuMemoryBufferFormatSupported( |
| 377 gpu_memory_buffer->GetFormat(), capabilities_)); |
376 DCHECK(gpu::ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat( | 378 DCHECK(gpu::ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat( |
377 gfx::Size(width, height), gpu_memory_buffer->GetFormat())); | 379 gfx::Size(width, height), gpu_memory_buffer->GetFormat())); |
378 DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( | 380 DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
379 internalformat, gpu_memory_buffer->GetFormat())); | 381 internalformat, gpu_memory_buffer->GetFormat())); |
380 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, | 382 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, |
381 new_id, | 383 new_id, |
382 handle, | 384 handle, |
383 gfx::Size(width, height), | 385 gfx::Size(width, height), |
384 gpu_memory_buffer->GetFormat(), | 386 gpu_memory_buffer->GetFormat(), |
385 internalformat))) { | 387 internalformat))) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 } | 608 } |
607 } | 609 } |
608 | 610 |
609 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 611 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
610 base::TimeDelta interval) { | 612 base::TimeDelta interval) { |
611 if (!update_vsync_parameters_completion_callback_.is_null()) | 613 if (!update_vsync_parameters_completion_callback_.is_null()) |
612 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 614 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
613 } | 615 } |
614 | 616 |
615 } // namespace content | 617 } // namespace content |
OLD | NEW |