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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 287553003: cc: Set requires high res upon becoming visible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 1730
1731 void LayerTreeHostImpl::SetVisible(bool visible) { 1731 void LayerTreeHostImpl::SetVisible(bool visible) {
1732 DCHECK(proxy_->IsImplThread()); 1732 DCHECK(proxy_->IsImplThread());
1733 1733
1734 if (visible_ == visible) 1734 if (visible_ == visible)
1735 return; 1735 return;
1736 visible_ = visible; 1736 visible_ = visible;
1737 DidVisibilityChange(this, visible_); 1737 DidVisibilityChange(this, visible_);
1738 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy()); 1738 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy());
1739 1739
1740 if (!visible_) { 1740 // If we just became visible, we have to ensure that we draw high res tiles,
1741 // to prevent checkerboard/low res flashes.
1742 if (visible_)
1741 active_tree()->SetRequiresHighResToDraw(); 1743 active_tree()->SetRequiresHighResToDraw();
1744 else
1742 EvictAllUIResources(); 1745 EvictAllUIResources();
1743 }
1744 1746
1745 // Evict tiles immediately if invisible since this tab may never get another 1747 // Evict tiles immediately if invisible since this tab may never get another
1746 // draw or timer tick. 1748 // draw or timer tick.
1747 if (!visible_) 1749 if (!visible_)
1748 ManageTiles(); 1750 ManageTiles();
1749 1751
1750 if (!renderer_) 1752 if (!renderer_)
1751 return; 1753 return;
1752 1754
1753 renderer_->SetVisible(visible); 1755 renderer_->SetVisible(visible);
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3117 swap_promise_monitor_.erase(monitor); 3119 swap_promise_monitor_.erase(monitor);
3118 } 3120 }
3119 3121
3120 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3122 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3121 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3123 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3122 for (; it != swap_promise_monitor_.end(); it++) 3124 for (; it != swap_promise_monitor_.end(); it++)
3123 (*it)->OnSetNeedsRedrawOnImpl(); 3125 (*it)->OnSetNeedsRedrawOnImpl();
3124 } 3126 }
3125 3127
3126 } // namespace cc 3128 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698