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. |