| 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/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 latency_info.begin(), latency_info.end()); | 155 latency_info.begin(), latency_info.end()); |
| 156 | 156 |
| 157 if (do_flush) | 157 if (do_flush) |
| 158 InternalFlush(&flush_info); | 158 InternalFlush(&flush_info); |
| 159 | 159 |
| 160 return flush_id; | 160 return flush_id; |
| 161 } | 161 } |
| 162 return 0; | 162 return 0; |
| 163 } | 163 } |
| 164 | 164 |
| 165 void GpuChannelHost::FlushPendingStream(int32 stream_id) { |
| 166 AutoLock lock(context_lock_); |
| 167 StreamFlushInfo& flush_info = stream_flush_info_[stream_id]; |
| 168 if (flush_info.flush_pending) |
| 169 InternalFlush(&flush_info); |
| 170 } |
| 171 |
| 165 void GpuChannelHost::InternalFlush(StreamFlushInfo* flush_info) { | 172 void GpuChannelHost::InternalFlush(StreamFlushInfo* flush_info) { |
| 166 context_lock_.AssertAcquired(); | 173 context_lock_.AssertAcquired(); |
| 167 DCHECK(flush_info); | 174 DCHECK(flush_info); |
| 168 DCHECK(flush_info->flush_pending); | 175 DCHECK(flush_info->flush_pending); |
| 169 DCHECK_LT(flush_info->flushed_stream_flush_id, flush_info->flush_id); | 176 DCHECK_LT(flush_info->flushed_stream_flush_id, flush_info->flush_id); |
| 170 Send(new GpuCommandBufferMsg_AsyncFlush( | 177 Send(new GpuCommandBufferMsg_AsyncFlush( |
| 171 flush_info->route_id, flush_info->put_offset, flush_info->flush_count, | 178 flush_info->route_id, flush_info->put_offset, flush_info->flush_count, |
| 172 flush_info->latency_info)); | 179 flush_info->latency_info)); |
| 173 flush_info->latency_info.clear(); | 180 flush_info->latency_info.clear(); |
| 174 flush_info->flush_pending = false; | 181 flush_info->flush_pending = false; |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 534 |
| 528 listeners_.clear(); | 535 listeners_.clear(); |
| 529 } | 536 } |
| 530 | 537 |
| 531 bool GpuChannelHost::MessageFilter::IsLost() const { | 538 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 532 AutoLock lock(lock_); | 539 AutoLock lock(lock_); |
| 533 return lost_; | 540 return lost_; |
| 534 } | 541 } |
| 535 | 542 |
| 536 } // namespace content | 543 } // namespace content |
| OLD | NEW |