Chromium Code Reviews| Index: content/renderer/gpu/compositor_software_output_device.cc |
| diff --git a/content/renderer/gpu/compositor_software_output_device.cc b/content/renderer/gpu/compositor_software_output_device.cc |
| index 77fbdb35a85472b5e19b8e6df404657576bf7d55..9959ecf1103abb2752ab3a1cc3076a46da89af93 100644 |
| --- a/content/renderer/gpu/compositor_software_output_device.cc |
| +++ b/content/renderer/gpu/compositor_software_output_device.cc |
| @@ -130,20 +130,21 @@ void CompositorSoftwareOutputDevice::EndPaint( |
| void CompositorSoftwareOutputDevice::ReclaimDIB(const TransportDIB::Id& id) { |
| DCHECK(CalledOnValidThread()); |
| - // The reclaimed handle might not be among the currently |
| + // The reclaimed dib id might not be among the currently |
| // active dibs if we got a resize event in the mean time. |
| ScopedVector<TransportDIB>::iterator it = |
| std::find_if(dibs_.begin(), dibs_.end(), CompareById(id)); |
| if (it != dibs_.end()) { |
| ++num_free_buffers_; |
| - } else { |
| - it = std::find_if(awaiting_ack_.begin(), |
| - awaiting_ack_.end(), |
| - CompareById(id)); |
| - awaiting_ack_.erase(it); |
| + DCHECK_LE(static_cast<size_t>(num_free_buffers_), dibs_.size()); |
| + return; |
| } |
| - DCHECK_LE(static_cast<size_t>(num_free_buffers_), dibs_.size()); |
| + // Check if this dib id is among awaiting_ack_. |
| + it = std::find_if(awaiting_ack_.begin(), awaiting_ack_.end(), |
| + CompareById(id)); |
| + if (it != awaiting_ack_.end()) |
|
piman
2013/04/03 18:31:26
Is there any case where we get here and this would
slavi
2013/04/03 21:38:22
Done.
|
| + awaiting_ack_.erase(it); |
| } |
| } // namespace content |