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

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

Issue 287643004: Re-land: cc: Examine layers to determine if we're ready to activate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: init check_if_ready_to_activate_pending_ properly 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 | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | 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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 1233
1234 void LayerTreeHostImpl::DidInitializeVisibleTile() { 1234 void LayerTreeHostImpl::DidInitializeVisibleTile() {
1235 if (client_ && !client_->IsInsideDraw()) 1235 if (client_ && !client_->IsInsideDraw())
1236 client_->DidInitializeVisibleTileOnImplThread(); 1236 client_->DidInitializeVisibleTileOnImplThread();
1237 } 1237 }
1238 1238
1239 void LayerTreeHostImpl::NotifyReadyToActivate() { 1239 void LayerTreeHostImpl::NotifyReadyToActivate() {
1240 client_->NotifyReadyToActivate(); 1240 client_->NotifyReadyToActivate();
1241 } 1241 }
1242 1242
1243 void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) { 1243 void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) {
1244 TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileInitialized"); 1244 TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileStateChanged");
1245 1245
1246 if (active_tree_) { 1246 if (active_tree_) {
1247 LayerImpl* layer_impl = 1247 LayerImpl* layer_impl =
1248 active_tree_->FindActiveTreeLayerById(tile->layer_id()); 1248 active_tree_->FindActiveTreeLayerById(tile->layer_id());
1249 if (layer_impl) 1249 if (layer_impl)
1250 layer_impl->NotifyTileInitialized(tile); 1250 layer_impl->NotifyTileStateChanged(tile);
1251 } 1251 }
1252 1252
1253 if (pending_tree_) { 1253 if (pending_tree_) {
1254 LayerImpl* layer_impl = 1254 LayerImpl* layer_impl =
1255 pending_tree_->FindPendingTreeLayerById(tile->layer_id()); 1255 pending_tree_->FindPendingTreeLayerById(tile->layer_id());
1256 if (layer_impl) 1256 if (layer_impl)
1257 layer_impl->NotifyTileInitialized(tile); 1257 layer_impl->NotifyTileStateChanged(tile);
1258 } 1258 }
1259 } 1259 }
1260 1260
1261 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 1261 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
1262 SetManagedMemoryPolicy(policy, zero_budget_); 1262 SetManagedMemoryPolicy(policy, zero_budget_);
1263 } 1263 }
1264 1264
1265 void LayerTreeHostImpl::SetTreeActivationCallback( 1265 void LayerTreeHostImpl::SetTreeActivationCallback(
1266 const base::Closure& callback) { 1266 const base::Closure& callback) {
1267 DCHECK(proxy_->IsImplThread()); 1267 DCHECK(proxy_->IsImplThread());
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 1915
1916 raster_worker_pool_ = PixelBufferRasterWorkerPool::Create( 1916 raster_worker_pool_ = PixelBufferRasterWorkerPool::Create(
1917 proxy_->ImplThreadTaskRunner(), 1917 proxy_->ImplThreadTaskRunner(),
1918 RasterWorkerPool::GetTaskGraphRunner(), 1918 RasterWorkerPool::GetTaskGraphRunner(),
1919 resource_provider_.get(), 1919 resource_provider_.get(),
1920 transfer_buffer_memory_limit_); 1920 transfer_buffer_memory_limit_);
1921 } 1921 }
1922 1922
1923 tile_manager_ = 1923 tile_manager_ =
1924 TileManager::Create(this, 1924 TileManager::Create(this,
1925 proxy_->ImplThreadTaskRunner(),
1925 resource_pool_.get(), 1926 resource_pool_.get(),
1926 raster_worker_pool_->AsRasterizer(), 1927 raster_worker_pool_->AsRasterizer(),
1927 GetRendererCapabilities().allow_rasterize_on_demand,
1928 rendering_stats_instrumentation_); 1928 rendering_stats_instrumentation_);
1929 1929
1930 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); 1930 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
1931 need_to_update_visible_tiles_before_draw_ = false; 1931 need_to_update_visible_tiles_before_draw_ = false;
1932 } 1932 }
1933 1933
1934 void LayerTreeHostImpl::DestroyTileManager() { 1934 void LayerTreeHostImpl::DestroyTileManager() {
1935 tile_manager_.reset(); 1935 tile_manager_.reset();
1936 resource_pool_.reset(); 1936 resource_pool_.reset();
1937 staging_resource_pool_.reset(); 1937 staging_resource_pool_.reset();
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 swap_promise_monitor_.erase(monitor); 3128 swap_promise_monitor_.erase(monitor);
3129 } 3129 }
3130 3130
3131 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3131 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3132 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3132 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3133 for (; it != swap_promise_monitor_.end(); it++) 3133 for (; it != swap_promise_monitor_.end(); it++)
3134 (*it)->OnSetNeedsRedrawOnImpl(); 3134 (*it)->OnSetNeedsRedrawOnImpl();
3135 } 3135 }
3136 3136
3137 } // namespace cc 3137 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698