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

Unified Diff: cc/trees/thread_proxy.cc

Issue 12662021: cc: Don't draw and swap if the frame will not change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 767226a79666dcb98a98cc21fd3e53078e392875..5edfd4912d9c556b42832f25c6668fd5807f80af 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -894,6 +894,11 @@ ThreadProxy::ScheduledActionDrawAndSwapInternal(bool forced_draw) {
// DrawLayers() depends on the result of PrepareToDraw(), it is guarded on
// CanDraw() as well.
+ // If it is a forced draw, make sure we do a draw and swap.
+ gfx::Rect readback_rect;
+ if (readback_request_on_impl_thread_)
+ readback_rect = readback_request_on_impl_thread_->rect;
+
LayerTreeHostImpl::FrameData frame;
bool draw_frame = false;
bool start_ready_animations = true;
@@ -901,7 +906,8 @@ ThreadProxy::ScheduledActionDrawAndSwapInternal(bool forced_draw) {
if (layer_tree_host_impl_->CanDraw()) {
// Do not start animations if we skip drawing the frame to avoid
// checkerboarding.
- if (layer_tree_host_impl_->PrepareToDraw(&frame) || forced_draw)
+ if (layer_tree_host_impl_->PrepareToDraw(&frame, readback_rect) ||
+ forced_draw)
draw_frame = true;
else
start_ready_animations = false;
@@ -939,7 +945,7 @@ ThreadProxy::ScheduledActionDrawAndSwapInternal(bool forced_draw) {
readback_request_on_impl_thread_->completion.Signal();
readback_request_on_impl_thread_ = NULL;
} else if (draw_frame) {
- result.did_swap = layer_tree_host_impl_->SwapBuffers();
+ result.did_swap = layer_tree_host_impl_->SwapBuffers(frame);
if (frame.contains_incomplete_tile)
DidSwapUseIncompleteTileOnImplThread();
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698