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

Unified Diff: cc/trees/thread_proxy.cc

Issue 14960006: cc: Don't do CompositeAndReadback when using DelegatingRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 6dd728569d7c87fa2bf38741f58d281fe3768665..3f6095b8b6410ba699882ad1402487b6369e5d87 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -913,16 +913,20 @@ 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;
+ bool drawing_for_readback = !!readback_request_on_impl_thread_;
+ bool can_do_readback = layer_tree_host_impl_->renderer()->CanReadPixels();
LayerTreeHostImpl::FrameData frame;
bool draw_frame = false;
bool start_ready_animations = true;
- if (layer_tree_host_impl_->CanDraw()) {
+ if (layer_tree_host_impl_->CanDraw() &&
+ (!drawing_for_readback || can_do_readback)) {
+ // If it is for a readback, make sure we draw the portion being read back.
+ gfx::Rect readback_rect;
+ if (drawing_for_readback)
+ readback_rect = readback_request_on_impl_thread_->rect;
+
// Do not start animations if we skip drawing the frame to avoid
// checkerboarding.
if (layer_tree_host_impl_->PrepareToDraw(&frame, readback_rect) ||
« 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