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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 params.gpu_memory_buffer = handle; | 442 params.gpu_memory_buffer = handle; |
443 params.size = gfx::Size(width, height); | 443 params.size = gfx::Size(width, height); |
444 params.format = gpu_memory_buffer->GetFormat(); | 444 params.format = gpu_memory_buffer->GetFormat(); |
445 params.internal_format = internal_format; | 445 params.internal_format = internal_format; |
446 params.image_release_count = image_fence_sync; | 446 params.image_release_count = image_fence_sync; |
447 | 447 |
448 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, params))) | 448 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, params))) |
449 return -1; | 449 return -1; |
450 | 450 |
451 if (image_fence_sync) { | 451 if (image_fence_sync) { |
452 gpu::SyncToken sync_token(GetNamespaceID(), GetCommandBufferID(), | 452 gpu::SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(), |
453 GetExtraCommandBufferData(), image_fence_sync); | 453 GetCommandBufferID(), image_fence_sync); |
454 | 454 |
455 // Force a synchronous IPC to validate sync token. | 455 // Force a synchronous IPC to validate sync token. |
456 channel_->ValidateFlushIDReachedServer(stream_id_, true); | 456 channel_->ValidateFlushIDReachedServer(stream_id_, true); |
457 sync_token.SetVerifyFlush(); | 457 sync_token.SetVerifyFlush(); |
458 | 458 |
459 gpu_memory_buffer_manager->SetDestructionSyncToken(gpu_memory_buffer, | 459 gpu_memory_buffer_manager->SetDestructionSyncToken(gpu_memory_buffer, |
460 sync_token); | 460 sync_token); |
461 } | 461 } |
462 | 462 |
463 return new_id; | 463 return new_id; |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 766 } |
767 } | 767 } |
768 | 768 |
769 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 769 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
770 base::TimeDelta interval) { | 770 base::TimeDelta interval) { |
771 if (!update_vsync_parameters_completion_callback_.is_null()) | 771 if (!update_vsync_parameters_completion_callback_.is_null()) |
772 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 772 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
773 } | 773 } |
774 | 774 |
775 } // namespace content | 775 } // namespace content |
OLD | NEW |