Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1922)

Unified Diff: content/renderer/gpu/compositor_software_output_device.cc

Issue 13042012: Browser side changes for software compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698