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

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

Issue 2188093002: cc: Complete swap promise for aborted commit after pending activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: post rebase fix Created 4 years, 4 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 // Setting property trees must happen before pushing the page scale. 505 // Setting property trees must happen before pushing the page scale.
506 sync_tree->SetPropertyTrees(&property_trees_); 506 sync_tree->SetPropertyTrees(&property_trees_);
507 507
508 sync_tree->PushPageScaleFromMainThread( 508 sync_tree->PushPageScaleFromMainThread(
509 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); 509 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_);
510 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); 510 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_);
511 if (sync_tree->IsActiveTree()) 511 if (sync_tree->IsActiveTree())
512 sync_tree->elastic_overscroll()->PushPendingToActive(); 512 sync_tree->elastic_overscroll()->PushPendingToActive();
513 513
514 sync_tree->PassSwapPromises(&swap_promise_list_); 514 sync_tree->PassSwapPromises(std::move(swap_promise_list_));
515 515
516 sync_tree->set_top_controls_shrink_blink_size( 516 sync_tree->set_top_controls_shrink_blink_size(
517 top_controls_shrink_blink_size_); 517 top_controls_shrink_blink_size_);
518 sync_tree->set_top_controls_height(top_controls_height_); 518 sync_tree->set_top_controls_height(top_controls_height_);
519 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); 519 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_);
520 520
521 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); 521 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
522 host_impl->SetContentIsSuitableForGpuRasterization( 522 host_impl->SetContentIsSuitableForGpuRasterization(
523 content_is_suitable_for_gpu_rasterization_); 523 content_is_suitable_for_gpu_rasterization_);
524 RecordGpuRasterizationHistogram(); 524 RecordGpuRasterizationHistogram();
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 DCHECK(swap_promise); 1283 DCHECK(swap_promise);
1284 swap_promise_list_.push_back(std::move(swap_promise)); 1284 swap_promise_list_.push_back(std::move(swap_promise));
1285 } 1285 }
1286 1286
1287 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1287 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1288 for (const auto& swap_promise : swap_promise_list_) 1288 for (const auto& swap_promise : swap_promise_list_)
1289 swap_promise->DidNotSwap(reason); 1289 swap_promise->DidNotSwap(reason);
1290 swap_promise_list_.clear(); 1290 swap_promise_list_.clear();
1291 } 1291 }
1292 1292
1293 std::vector<std::unique_ptr<SwapPromise>> LayerTreeHost::TakeSwapPromises() {
1294 std::vector<std::unique_ptr<SwapPromise>> to_return;
1295 to_return.swap(swap_promise_list_);
1296 return to_return;
1297 }
1298
1293 void LayerTreeHost::OnCommitForSwapPromises() { 1299 void LayerTreeHost::OnCommitForSwapPromises() {
1294 for (const auto& swap_promise : swap_promise_list_) 1300 for (const auto& swap_promise : swap_promise_list_)
1295 swap_promise->OnCommit(); 1301 swap_promise->OnCommit();
1296 } 1302 }
1297 1303
1298 void LayerTreeHost::set_surface_client_id(uint32_t client_id) { 1304 void LayerTreeHost::set_surface_client_id(uint32_t client_id) {
1299 surface_client_id_ = client_id; 1305 surface_client_id_ = client_id;
1300 } 1306 }
1301 1307
1302 SurfaceSequence LayerTreeHost::CreateSurfaceSequence() { 1308 SurfaceSequence LayerTreeHost::CreateSurfaceSequence() {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 1675
1670 surface_client_id_ = proto.surface_client_id(); 1676 surface_client_id_ = proto.surface_client_id();
1671 next_surface_sequence_ = proto.next_surface_sequence(); 1677 next_surface_sequence_ = proto.next_surface_sequence();
1672 } 1678 }
1673 1679
1674 AnimationHost* LayerTreeHost::animation_host() const { 1680 AnimationHost* LayerTreeHost::animation_host() const {
1675 return layer_tree_.animation_host(); 1681 return layer_tree_.animation_host();
1676 } 1682 }
1677 1683
1678 } // namespace cc 1684 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698