| 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure"; | 439 DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure"; |
| 440 return 0; | 440 return 0; |
| 441 } | 441 } |
| 442 return stream_id; | 442 return stream_id; |
| 443 } | 443 } |
| 444 | 444 |
| 445 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { | 445 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { |
| 446 lock_ = lock; | 446 lock_ = lock; |
| 447 } | 447 } |
| 448 | 448 |
| 449 bool CommandBufferProxyImpl::IsGpuChannelLost() { |
| 450 return !channel_ || channel_->IsLost(); |
| 451 } |
| 452 |
| 449 uint32 CommandBufferProxyImpl::InsertSyncPoint() { | 453 uint32 CommandBufferProxyImpl::InsertSyncPoint() { |
| 450 CheckLock(); | 454 CheckLock(); |
| 451 if (last_state_.error != gpu::error::kNoError) | 455 if (last_state_.error != gpu::error::kNoError) |
| 452 return 0; | 456 return 0; |
| 453 | 457 |
| 454 uint32 sync_point = 0; | 458 uint32 sync_point = 0; |
| 455 Send(new GpuCommandBufferMsg_InsertSyncPoint(route_id_, true, &sync_point)); | 459 Send(new GpuCommandBufferMsg_InsertSyncPoint(route_id_, true, &sync_point)); |
| 456 return sync_point; | 460 return sync_point; |
| 457 } | 461 } |
| 458 | 462 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 } | 615 } |
| 612 } | 616 } |
| 613 | 617 |
| 614 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 618 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
| 615 base::TimeDelta interval) { | 619 base::TimeDelta interval) { |
| 616 if (!update_vsync_parameters_completion_callback_.is_null()) | 620 if (!update_vsync_parameters_completion_callback_.is_null()) |
| 617 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 621 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
| 618 } | 622 } |
| 619 | 623 |
| 620 } // namespace content | 624 } // namespace content |
| OLD | NEW |