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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 1454323002: Display skips swapping if overlays draw the damage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try skipping the swap at the cc::OutputSurface level Created 5 years, 1 month 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
« cc/output/gl_renderer.cc ('K') | « cc/output/gl_renderer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 3f2ee6408a78d205be1a704ae2ae865a8493fa8a..e618c200388f3767db73d1af8682e4419ffb7e69 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -94,10 +94,16 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface,
void SwapBuffers(cc::CompositorFrame* frame) override {
GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info);
- DCHECK(frame->gl_frame_data->sub_buffer_rect ==
- gfx::Rect(frame->gl_frame_data->size));
- context_provider_->ContextSupport()->Swap();
- client_->DidSwapBuffers();
+ // Partial swap is not supported, so if the |sub_buffer_rect| is non-empty
+ // swap the whole buffer. Otherwise, there is no damage, so don't
+ // swap at all.
+ if (!frame->gl_frame_data->sub_buffer_rect.IsEmpty()) {
+ context_provider_->ContextSupport()->Swap();
+ client_->DidSwapBuffers();
+ } else {
+ client_->DidSwapBuffers();
+ OutputSurface::OnSwapBuffersComplete();
+ }
}
bool BindToClient(cc::OutputSurfaceClient* client) override {
« cc/output/gl_renderer.cc ('K') | « cc/output/gl_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698