Index: ui/compositor/compositor.cc |
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc |
index e68d6370415e8b1f9addb956b10d4728b8689ed5..8f11ee3b7ebe18f24c885cfe4fff089d7c223547 100644 |
--- a/ui/compositor/compositor.cc |
+++ b/ui/compositor/compositor.cc |
@@ -83,6 +83,7 @@ Compositor::Compositor(gfx::AcceleratedWidget widget, |
disable_schedule_composite_(false), |
compositor_lock_(NULL), |
defer_draw_scheduling_(false), |
+ block_drawing_(false), |
waiting_on_compositing_end_(false), |
draw_on_compositing_end_(false), |
swap_state_(SWAP_NONE), |
@@ -187,6 +188,19 @@ void Compositor::ScheduleDraw() { |
} |
} |
+void Compositor::SetBlockDrawing(bool block_drawing) { |
+ DCHECK(!compositor_thread_loop_); |
+ |
+ if (block_drawing_ == block_drawing) |
+ return; |
+ |
+ block_drawing_ = block_drawing; |
+ defer_draw_scheduling_ = block_drawing; |
+ |
+ if (!block_drawing) |
+ ScheduleDraw(); |
+} |
+ |
void Compositor::SetRootLayer(Layer* root_layer) { |
if (root_layer_ == root_layer) |
return; |
@@ -208,6 +222,9 @@ void Compositor::SetHostHasTransparentBackground( |
void Compositor::Draw() { |
DCHECK(!compositor_thread_loop_.get()); |
+ if (block_drawing_) |
+ return; |
+ |
defer_draw_scheduling_ = false; |
if (waiting_on_compositing_end_) { |
draw_on_compositing_end_ = true; |