| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 523 |
| 524 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { | 524 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { |
| 525 lock_ = lock; | 525 lock_ = lock; |
| 526 } | 526 } |
| 527 | 527 |
| 528 bool CommandBufferProxyImpl::IsGpuChannelLost() { | 528 bool CommandBufferProxyImpl::IsGpuChannelLost() { |
| 529 return !channel_ || channel_->IsLost(); | 529 return !channel_ || channel_->IsLost(); |
| 530 } | 530 } |
| 531 | 531 |
| 532 void CommandBufferProxyImpl::EnsureWorkVisible() { | 532 void CommandBufferProxyImpl::EnsureWorkVisible() { |
| 533 channel_->ValidateFlushIDReachedServer(stream_id_, true); | 533 if (channel_) |
| 534 channel_->ValidateFlushIDReachedServer(stream_id_, true); |
| 534 } | 535 } |
| 535 | 536 |
| 536 gpu::CommandBufferNamespace CommandBufferProxyImpl::GetNamespaceID() const { | 537 gpu::CommandBufferNamespace CommandBufferProxyImpl::GetNamespaceID() const { |
| 537 return gpu::CommandBufferNamespace::GPU_IO; | 538 return gpu::CommandBufferNamespace::GPU_IO; |
| 538 } | 539 } |
| 539 | 540 |
| 540 uint64_t CommandBufferProxyImpl::GetCommandBufferID() const { | 541 uint64_t CommandBufferProxyImpl::GetCommandBufferID() const { |
| 541 return command_buffer_id_; | 542 return command_buffer_id_; |
| 542 } | 543 } |
| 543 | 544 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 } | 811 } |
| 811 | 812 |
| 812 void CommandBufferProxyImpl::InvalidGpuReplyOnClientThread() { | 813 void CommandBufferProxyImpl::InvalidGpuReplyOnClientThread() { |
| 813 scoped_ptr<base::AutoLock> lock; | 814 scoped_ptr<base::AutoLock> lock; |
| 814 if (lock_) | 815 if (lock_) |
| 815 lock.reset(new base::AutoLock(*lock_)); | 816 lock.reset(new base::AutoLock(*lock_)); |
| 816 OnDestroyed(gpu::error::kInvalidGpuMessage, gpu::error::kLostContext); | 817 OnDestroyed(gpu::error::kInvalidGpuMessage, gpu::error::kLostContext); |
| 817 } | 818 } |
| 818 | 819 |
| 819 } // namespace content | 820 } // namespace content |
| OLD | NEW |