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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 290573007: cc: Move gpu rasterization flag from tree-impl to tree-host-impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index b3911f86ac186be311f4a8878bd179a1853fdd51..2294bb5885caeaf89ae838229ced63c8082bd76b 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -215,6 +215,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
int id)
: client_(client),
proxy_(proxy),
+ use_gpu_rasterization_(false),
input_handler_client_(NULL),
did_lock_scrolling_layer_(false),
should_bubble_scrolls_(false),
@@ -1520,6 +1521,19 @@ bool LayerTreeHostImpl::IsContextLost() {
return renderer_ && renderer_->IsContextLost();
}
+void LayerTreeHostImpl::SetUseGpuRasterization(bool use_gpu) {
+ if (use_gpu == use_gpu_rasterization_)
+ return;
+
+ use_gpu_rasterization_ = use_gpu;
+ ReleaseTreeResources();
+
+ // We have released tilings for both active and pending tree.
+ // We would not have any content to draw until the pending tree is activated.
+ // Prevent the active tree from drawing until activation.
+ active_tree_->SetRequiresHighResToDraw();
+}
+
const RendererCapabilitiesImpl&
LayerTreeHostImpl::GetRendererCapabilities() const {
return renderer_->Capabilities();
@@ -1773,13 +1787,10 @@ void LayerTreeHostImpl::SetNeedsRedraw() {
ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const {
ManagedMemoryPolicy actual = cached_managed_memory_policy_;
- bool any_tree_use_gpu_rasterization =
- (active_tree_ && active_tree_->use_gpu_rasterization()) ||
- (pending_tree_ && pending_tree_->use_gpu_rasterization());
if (debug_state_.rasterize_only_visible_content) {
actual.priority_cutoff_when_visible =
gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY;
- } else if (any_tree_use_gpu_rasterization) {
+ } else if (use_gpu_rasterization()) {
actual.priority_cutoff_when_visible =
gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698