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

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

Issue 219963005: cc: Add support for partial swaps when using impl-side painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP - comments + nits Created 6 years, 8 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
« cc/trees/damage_tracker.cc ('K') | « 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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 } 1205 }
1206 1206
1207 void LayerTreeHostImpl::DidModifyTilePriorities() { 1207 void LayerTreeHostImpl::DidModifyTilePriorities() {
1208 DCHECK(settings_.impl_side_painting); 1208 DCHECK(settings_.impl_side_painting);
1209 // Mark priorities as dirty and schedule a ManageTiles(). 1209 // Mark priorities as dirty and schedule a ManageTiles().
1210 tile_priorities_dirty_ = true; 1210 tile_priorities_dirty_ = true;
1211 client_->SetNeedsManageTilesOnImplThread(); 1211 client_->SetNeedsManageTilesOnImplThread();
1212 } 1212 }
1213 1213
1214 void LayerTreeHostImpl::DidInitializeVisibleTile() { 1214 void LayerTreeHostImpl::DidInitializeVisibleTile() {
1215 // TODO(reveman): Determine tiles that changed and only damage
1216 // what's necessary.
1217 SetFullRootLayerDamage();
1218 if (client_ && !client_->IsInsideDraw()) 1215 if (client_ && !client_->IsInsideDraw())
1219 client_->DidInitializeVisibleTileOnImplThread(); 1216 client_->DidInitializeVisibleTileOnImplThread();
1220 } 1217 }
1221 1218
1222 void LayerTreeHostImpl::NotifyReadyToActivate() { 1219 void LayerTreeHostImpl::NotifyReadyToActivate() {
1223 client_->NotifyReadyToActivate(); 1220 client_->NotifyReadyToActivate();
1224 } 1221 }
1225 1222
1223 void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) {
1224 if (!active_tree_)
1225 return;
1226
1227 LayerImpl* layer_impl =
1228 active_tree_->FindActiveTreeLayerById(tile->layer_id());
1229 if (layer_impl) {
1230 gfx::RectF tile_in_layer_content_rect =
reveman 2014/04/15 16:25:59 is this supposed to be tile_content_rect_in_layer_
enne (OOO) 2014/04/15 17:27:27 I think this should just be called layer_rect or l
1231 gfx::ScaleRect(tile->content_rect(), 1 / tile->contents_scale());
enne (OOO) 2014/04/15 17:27:27 nit: 1 => 1.f
1232 layer_impl->UnionDamageContentRect(tile_in_layer_content_rect);
enne (OOO) 2014/04/15 17:27:27 This function seems misnamed. It should be UnionD
1233 }
1234 }
1235
1226 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 1236 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
1227 SetManagedMemoryPolicy(policy, zero_budget_); 1237 SetManagedMemoryPolicy(policy, zero_budget_);
1228 } 1238 }
1229 1239
1230 void LayerTreeHostImpl::SetTreeActivationCallback( 1240 void LayerTreeHostImpl::SetTreeActivationCallback(
1231 const base::Closure& callback) { 1241 const base::Closure& callback) {
1232 DCHECK(proxy_->IsImplThread()); 1242 DCHECK(proxy_->IsImplThread());
1233 DCHECK(settings_.impl_side_painting || callback.is_null()); 1243 DCHECK(settings_.impl_side_painting || callback.is_null());
1234 tree_activation_callback_ = callback; 1244 tree_activation_callback_ = callback;
1235 } 1245 }
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3101 swap_promise_monitor_.erase(monitor); 3111 swap_promise_monitor_.erase(monitor);
3102 } 3112 }
3103 3113
3104 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3114 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3105 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3115 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3106 for (; it != swap_promise_monitor_.end(); it++) 3116 for (; it != swap_promise_monitor_.end(); it++)
3107 (*it)->OnSetNeedsRedrawOnImpl(); 3117 (*it)->OnSetNeedsRedrawOnImpl();
3108 } 3118 }
3109 3119
3110 } // namespace cc 3120 } // namespace cc
OLDNEW
« cc/trees/damage_tracker.cc ('K') | « 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