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

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

Issue 252293003: cc: Make LTHI::NotifyTileInitialized more generic. (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 | « cc/layers/picture_layer_impl.cc ('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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 void LayerTreeHostImpl::DidInitializeVisibleTile() { 1211 void LayerTreeHostImpl::DidInitializeVisibleTile() {
1212 if (client_ && !client_->IsInsideDraw()) 1212 if (client_ && !client_->IsInsideDraw())
1213 client_->DidInitializeVisibleTileOnImplThread(); 1213 client_->DidInitializeVisibleTileOnImplThread();
1214 } 1214 }
1215 1215
1216 void LayerTreeHostImpl::NotifyReadyToActivate() { 1216 void LayerTreeHostImpl::NotifyReadyToActivate() {
1217 client_->NotifyReadyToActivate(); 1217 client_->NotifyReadyToActivate();
1218 } 1218 }
1219 1219
1220 void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) { 1220 void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) {
1221 if (!active_tree_) 1221 TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileInitialized");
1222 return;
1223 1222
1224 LayerImpl* layer_impl = 1223 if (active_tree_) {
1225 active_tree_->FindActiveTreeLayerById(tile->layer_id()); 1224 LayerImpl* layer_impl =
1226 if (layer_impl) { 1225 active_tree_->FindActiveTreeLayerById(tile->layer_id());
1227 gfx::RectF layer_damage_rect = 1226 if (layer_impl)
1228 gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale()); 1227 layer_impl->NotifyTileInitialized(tile);
1229 layer_impl->AddDamageRect(layer_damage_rect); 1228 }
1229
1230 if (pending_tree_) {
1231 LayerImpl* layer_impl =
1232 pending_tree_->FindPendingTreeLayerById(tile->layer_id());
1233 if (layer_impl)
1234 layer_impl->NotifyTileInitialized(tile);
1230 } 1235 }
1231 } 1236 }
1232 1237
1233 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 1238 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
1234 SetManagedMemoryPolicy(policy, zero_budget_); 1239 SetManagedMemoryPolicy(policy, zero_budget_);
1235 } 1240 }
1236 1241
1237 void LayerTreeHostImpl::SetTreeActivationCallback( 1242 void LayerTreeHostImpl::SetTreeActivationCallback(
1238 const base::Closure& callback) { 1243 const base::Closure& callback) {
1239 DCHECK(proxy_->IsImplThread()); 1244 DCHECK(proxy_->IsImplThread());
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
3070 swap_promise_monitor_.erase(monitor); 3075 swap_promise_monitor_.erase(monitor);
3071 } 3076 }
3072 3077
3073 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3078 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3074 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3079 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3075 for (; it != swap_promise_monitor_.end(); it++) 3080 for (; it != swap_promise_monitor_.end(); it++)
3076 (*it)->OnSetNeedsRedrawOnImpl(); 3081 (*it)->OnSetNeedsRedrawOnImpl();
3077 } 3082 }
3078 3083
3079 } // namespace cc 3084 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698