OLD | NEW |
---|---|
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 active_tree_->ResetContentsTexturesPurged(); | 325 active_tree_->ResetContentsTexturesPurged(); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 void LayerTreeHostImpl::BeginCommit() {} | 329 void LayerTreeHostImpl::BeginCommit() {} |
330 | 330 |
331 void LayerTreeHostImpl::CommitComplete() { | 331 void LayerTreeHostImpl::CommitComplete() { |
332 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); | 332 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
333 | 333 |
334 if (settings_.impl_side_painting) { | 334 if (settings_.impl_side_painting) { |
335 if (pending_tree_->use_gpu_rasterization() != | |
336 active_tree_->use_gpu_rasterization()) { | |
337 // We need to recreate tilings for all layers in the pending tree. | |
338 // The tile size and rasterization is different for sw and gpu rasterizer. | |
339 SendReleaseResourcesRecursive(pending_tree_->root_layer()); | |
enne (OOO)
2014/05/09 19:13:27
I think you should have the tree do this internall
alokp
2014/05/09 19:59:55
Done.
| |
340 // TODO(alokp): Rip out rasterizer delegate and switch rasterizers here. | |
341 } | |
335 // Impl-side painting needs an update immediately post-commit to have the | 342 // Impl-side painting needs an update immediately post-commit to have the |
336 // opportunity to create tilings. Other paths can call UpdateDrawProperties | 343 // opportunity to create tilings. Other paths can call UpdateDrawProperties |
337 // more lazily when needed prior to drawing. | 344 // more lazily when needed prior to drawing. |
338 pending_tree()->ApplyScrollDeltasSinceBeginMainFrame(); | 345 pending_tree()->ApplyScrollDeltasSinceBeginMainFrame(); |
339 pending_tree_->set_needs_update_draw_properties(); | 346 pending_tree_->set_needs_update_draw_properties(); |
340 pending_tree_->UpdateDrawProperties(); | 347 pending_tree_->UpdateDrawProperties(); |
341 // Start working on newly created tiles immediately if needed. | 348 // Start working on newly created tiles immediately if needed. |
342 if (!tile_manager_ || !tile_priorities_dirty_) | 349 if (!tile_manager_ || !tile_priorities_dirty_) |
343 NotifyReadyToActivate(); | 350 NotifyReadyToActivate(); |
344 else | 351 else |
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3146 swap_promise_monitor_.erase(monitor); | 3153 swap_promise_monitor_.erase(monitor); |
3147 } | 3154 } |
3148 | 3155 |
3149 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3156 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3150 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3157 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3151 for (; it != swap_promise_monitor_.end(); it++) | 3158 for (; it != swap_promise_monitor_.end(); it++) |
3152 (*it)->OnSetNeedsRedrawOnImpl(); | 3159 (*it)->OnSetNeedsRedrawOnImpl(); |
3153 } | 3160 } |
3154 | 3161 |
3155 } // namespace cc | 3162 } // namespace cc |
OLD | NEW |