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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 128 } |
129 | 129 |
130 if (!channel_.get()) { | 130 if (!channel_.get()) { |
131 delete message; | 131 delete message; |
132 return false; | 132 return false; |
133 } | 133 } |
134 | 134 |
135 return channel_->Send(message); | 135 return channel_->Send(message); |
136 } | 136 } |
137 | 137 |
| 138 void GpuChannel::AppendAllCommandBufferStubs( |
| 139 std::vector<GpuMemoryManageableCommandBufferStub*>& stubs_with_surface, |
| 140 std::vector<GpuMemoryManageableCommandBufferStub*>& stubs_without_surface) { |
| 141 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
| 142 !it.IsAtEnd(); it.Advance()) { |
| 143 GpuMemoryManageableCommandBufferStub* stub = it.GetCurrentValue(); |
| 144 if (stub->surface_state().surface_id == 0) |
| 145 stubs_without_surface.push_back(stub); |
| 146 else |
| 147 stubs_with_surface.push_back(stub); |
| 148 } |
| 149 } |
| 150 |
138 bool GpuChannel::IsScheduled() { | 151 bool GpuChannel::IsScheduled() { |
139 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 152 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
140 !it.IsAtEnd(); | 153 !it.IsAtEnd(); |
141 it.Advance()) { | 154 it.Advance()) { |
142 GpuCommandBufferStub* stub = it.GetCurrentValue(); | 155 GpuCommandBufferStub* stub = it.GetCurrentValue(); |
143 if (!stub->IsScheduled()) | 156 if (!stub->IsScheduled()) |
144 return false; | 157 return false; |
145 } | 158 } |
146 | 159 |
147 return true; | 160 return true; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 445 |
433 #if defined(OS_POSIX) | 446 #if defined(OS_POSIX) |
434 int GpuChannel::TakeRendererFileDescriptor() { | 447 int GpuChannel::TakeRendererFileDescriptor() { |
435 if (!channel_.get()) { | 448 if (!channel_.get()) { |
436 NOTREACHED(); | 449 NOTREACHED(); |
437 return -1; | 450 return -1; |
438 } | 451 } |
439 return channel_->TakeClientFileDescriptor(); | 452 return channel_->TakeClientFileDescriptor(); |
440 } | 453 } |
441 #endif // defined(OS_POSIX) | 454 #endif // defined(OS_POSIX) |
OLD | NEW |