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

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

Issue 1091323002: Send a message through the ozone channel to recreate buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/browser/compositor/buffer_queue.cc
diff --git a/content/browser/compositor/buffer_queue.cc b/content/browser/compositor/buffer_queue.cc
index 689288f6d63b75d10c0b329fb32205d234ee1140..b6f4815c34851bcb802e03fd9661f281136710c1 100644
--- a/content/browser/compositor/buffer_queue.cc
+++ b/content/browser/compositor/buffer_queue.cc
@@ -120,6 +120,26 @@ void BufferQueue::Reshape(const gfx::Size& size, float scale_factor) {
FreeAllSurfaces();
}
+void BufferQueue::RecreateBuffers() {
+ AllocatedSurface previous = in_flight_surfaces_.back();
+ in_flight_surfaces_.pop_back();
+ FreeAllSurfaces();
+ FreeSurface(&current_surface_);
+
+ AllocatedSurface first_buffer = GetNextSurface();
+ CopyBufferDamage(first_buffer.texture, previous.texture, gfx::Rect(),
+ gfx::Rect(size_));
+ in_flight_surfaces_.push_back(first_buffer);
+
+ AllocatedSurface second_buffer = GetNextSurface();
+ CopyBufferDamage(second_buffer.texture, previous.texture, gfx::Rect(),
+ gfx::Rect(size_));
+ available_surfaces_.push_back(second_buffer);
+
+ BindFramebuffer();
+ FreeSurface(&previous);
+}
+
void BufferQueue::PageFlipComplete() {
if (in_flight_surfaces_.size() > 1) {
available_surfaces_.push_back(in_flight_surfaces_.front());

Powered by Google App Engine
This is Rietveld 408576698