OLD | NEW |
---|---|
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 Loading... | |
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(); |
enne (OOO)
2014/05/13 18:21:53
I was originally going to suggest that maybe we se
danakj
2014/05/13 18:23:13
Or when becoming visible. +1 to that either way.
| |
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 Loading... | |
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 |
OLD | NEW |