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

Unified Diff: content/browser/compositor/buffer_queue.cc

Issue 781683005: Ozone: Avoid blocking in Swapbuffer Call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments. Created 6 years 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
« no previous file with comments | « content/browser/compositor/buffer_queue.h ('k') | ui/ozone/platform/dri/gbm_surfaceless.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/buffer_queue.cc
diff --git a/content/browser/compositor/buffer_queue.cc b/content/browser/compositor/buffer_queue.cc
index ebb01658ccba55c0a1401e9fba4b3e4b22d41bb0..b91be5361c45c0d08bb258bd7955841c4e03a3da 100644
--- a/content/browser/compositor/buffer_queue.cc
+++ b/content/browser/compositor/buffer_queue.cc
@@ -70,8 +70,8 @@ void BufferQueue::CopyBufferDamage(int texture,
}
void BufferQueue::UpdateBufferDamage(const gfx::Rect& damage) {
- for (size_t i = 0; i < available_surfaces_.size(); i++)
- available_surfaces_[i].damage.Union(damage);
achaulk 2014/12/05 20:12:20 This would have to stay to handle rare cases
+ for (size_t i = 0; i < display_queue_surfaces_.size(); i++)
+ display_queue_surfaces_[i].damage.Union(damage);
for (std::deque<AllocatedSurface>::iterator it =
in_flight_surfaces_.begin();
it != in_flight_surfaces_.end();
@@ -111,8 +111,16 @@ void BufferQueue::Reshape(const gfx::Size& size, float scale_factor) {
}
void BufferQueue::PageFlipComplete() {
+ // The surface is already displayed on screen and is available for use.
+ if (display_queue_surfaces_.size() > 0) {
+ available_surfaces_.push_back(display_queue_surfaces_.front());
+ display_queue_surfaces_.pop_front();
achaulk 2014/12/05 20:12:19 I'm not sure what the point of this extra list (of
+ }
+
+ // We have requested page flip for the surface and it's waiting to be
+ // displayed. Let's not put it back to free list yet.
if (in_flight_surfaces_.size() > 1) {
- available_surfaces_.push_back(in_flight_surfaces_.front());
+ display_queue_surfaces_.push_back(in_flight_surfaces_.front());
in_flight_surfaces_.pop_front();
}
}
@@ -123,6 +131,10 @@ void BufferQueue::FreeAllSurfaces() {
FreeSurface(&in_flight_surfaces_.front());
in_flight_surfaces_.pop_front();
}
+ while (!display_queue_surfaces_.empty()) {
+ FreeSurface(&display_queue_surfaces_.front());
+ display_queue_surfaces_.pop_front();
+ }
for (size_t i = 0; i < available_surfaces_.size(); i++)
FreeSurface(&available_surfaces_[i]);
available_surfaces_.clear();
« no previous file with comments | « content/browser/compositor/buffer_queue.h ('k') | ui/ozone/platform/dri/gbm_surfaceless.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698