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

Unified Diff: components/display_compositor/buffer_queue.cc

Issue 2776923003: cc: Partial draw without partial swap support. (Closed)
Patch Set: avoid BufferQueue::RecreateBuffer changes Created 3 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: components/display_compositor/buffer_queue.cc
diff --git a/components/display_compositor/buffer_queue.cc b/components/display_compositor/buffer_queue.cc
index afb40e1a4912accfc68929b8d7b72d70e7ac8cb8..b63833c49a05258f6ea9b5e2801f88ae677f9afe 100644
--- a/components/display_compositor/buffer_queue.cc
+++ b/components/display_compositor/buffer_queue.cc
@@ -67,6 +67,14 @@ void BufferQueue::BindFramebuffer() {
}
}
+bool BufferQueue::CanPartialDraw(const gfx::Rect& damage) {
+ if (current_surface_)
+ return damage.Contains(current_surface_->damage);
+ if (!available_surfaces_.empty())
+ return damage.Contains(available_surfaces_.back()->damage);
+ return false;
+}
+
void BufferQueue::CopyBufferDamage(int texture,
int source_texture,
const gfx::Rect& new_damage,
@@ -89,7 +97,7 @@ void BufferQueue::UpdateBufferDamage(const gfx::Rect& damage) {
void BufferQueue::SwapBuffers(const gfx::Rect& damage) {
if (current_surface_) {
- if (damage != gfx::Rect(size_)) {
+ if (!damage.Contains(current_surface_->damage)) {
// Copy damage from the most recently swapped buffer. In the event that
// the buffer was destroyed and failed to recreate, pick from the most
// recently available buffer.
« no previous file with comments | « components/display_compositor/buffer_queue.h ('k') | content/browser/compositor/browser_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698