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

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

Issue 181063022: cc: Trigger GPU rasterization based on a per-layer hint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 9 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
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 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 client_->SetNeedsRedrawOnImplThread(); 1695 client_->SetNeedsRedrawOnImplThread();
1696 } 1696 }
1697 1697
1698 ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { 1698 ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const {
1699 ManagedMemoryPolicy actual = cached_managed_memory_policy_; 1699 ManagedMemoryPolicy actual = cached_managed_memory_policy_;
1700 // TODO(ernstm): The second condition disables pre-painting for all layers 1700 // TODO(ernstm): The second condition disables pre-painting for all layers
1701 // when GPU rasterization is enabled. Once we selectively enable GPU 1701 // when GPU rasterization is enabled. Once we selectively enable GPU
1702 // rasterization per layer, we also need to disable pre-painting selectively: 1702 // rasterization per layer, we also need to disable pre-painting selectively:
1703 // crbug.com/335387 1703 // crbug.com/335387
1704 if (debug_state_.rasterize_only_visible_content || 1704 if (debug_state_.rasterize_only_visible_content ||
1705 settings_.gpu_rasterization) { 1705 settings_.rasterization_site !=
1706 LayerTreeSettings::CpuRasterization) {
1706 actual.priority_cutoff_when_visible = 1707 actual.priority_cutoff_when_visible =
1707 gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; 1708 gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY;
1708 } 1709 }
1709 1710
1710 if (zero_budget_) { 1711 if (zero_budget_) {
1711 actual.bytes_limit_when_visible = 0; 1712 actual.bytes_limit_when_visible = 0;
1712 } 1713 }
1713 1714
1714 return actual; 1715 return actual;
1715 } 1716 }
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 swap_promise_monitor_.erase(monitor); 3030 swap_promise_monitor_.erase(monitor);
3030 } 3031 }
3031 3032
3032 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3033 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3033 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3034 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3034 for (; it != swap_promise_monitor_.end(); it++) 3035 for (; it != swap_promise_monitor_.end(); it++)
3035 (*it)->OnSetNeedsRedrawOnImpl(); 3036 (*it)->OnSetNeedsRedrawOnImpl();
3036 } 3037 }
3037 3038
3038 } // namespace cc 3039 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698