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

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: fix compile error 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
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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 508 }
509 // Setting property trees must happen before pushing the page scale. 509 // Setting property trees must happen before pushing the page scale.
510 sync_tree->SetPropertyTrees(&property_trees_); 510 sync_tree->SetPropertyTrees(&property_trees_);
511 511
512 sync_tree->PushPageScaleFromMainThread( 512 sync_tree->PushPageScaleFromMainThread(
513 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); 513 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_);
514 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); 514 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_);
515 if (sync_tree->IsActiveTree()) 515 if (sync_tree->IsActiveTree())
516 sync_tree->elastic_overscroll()->PushPendingToActive(); 516 sync_tree->elastic_overscroll()->PushPendingToActive();
517 517
518 sync_tree->PassSwapPromises(&swap_promise_list_); 518 sync_tree->PassSwapPromises(std::move(swap_promise_list_));
519 519
520 sync_tree->set_top_controls_shrink_blink_size( 520 sync_tree->set_top_controls_shrink_blink_size(
521 top_controls_shrink_blink_size_); 521 top_controls_shrink_blink_size_);
522 sync_tree->set_top_controls_height(top_controls_height_); 522 sync_tree->set_top_controls_height(top_controls_height_);
523 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); 523 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_);
524 524
525 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); 525 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
526 host_impl->SetContentIsSuitableForGpuRasterization( 526 host_impl->SetContentIsSuitableForGpuRasterization(
527 content_is_suitable_for_gpu_rasterization_); 527 content_is_suitable_for_gpu_rasterization_);
528 RecordGpuRasterizationHistogram(); 528 RecordGpuRasterizationHistogram();
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 DCHECK(swap_promise); 1290 DCHECK(swap_promise);
1291 swap_promise_list_.push_back(std::move(swap_promise)); 1291 swap_promise_list_.push_back(std::move(swap_promise));
1292 } 1292 }
1293 1293
1294 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1294 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1295 for (const auto& swap_promise : swap_promise_list_) 1295 for (const auto& swap_promise : swap_promise_list_)
1296 swap_promise->DidNotSwap(reason); 1296 swap_promise->DidNotSwap(reason);
1297 swap_promise_list_.clear(); 1297 swap_promise_list_.clear();
1298 } 1298 }
1299 1299
1300 std::vector<std::unique_ptr<SwapPromise>> LayerTreeHost::TakeSwapPromises() {
1301 std::vector<std::unique_ptr<SwapPromise>> to_return;
1302 to_return.swap(swap_promise_list_);
1303 return to_return;
1304 }
1305
1300 void LayerTreeHost::OnCommitForSwapPromises() { 1306 void LayerTreeHost::OnCommitForSwapPromises() {
1301 for (const auto& swap_promise : swap_promise_list_) 1307 for (const auto& swap_promise : swap_promise_list_)
1302 swap_promise->OnCommit(); 1308 swap_promise->OnCommit();
1303 } 1309 }
1304 1310
1305 void LayerTreeHost::set_surface_client_id(uint32_t client_id) { 1311 void LayerTreeHost::set_surface_client_id(uint32_t client_id) {
1306 surface_client_id_ = client_id; 1312 surface_client_id_ = client_id;
1307 } 1313 }
1308 1314
1309 SurfaceSequence LayerTreeHost::CreateSurfaceSequence() { 1315 SurfaceSequence LayerTreeHost::CreateSurfaceSequence() {
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 int seq_num = property_trees_.sequence_number; 1721 int seq_num = property_trees_.sequence_number;
1716 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { 1722 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) {
1717 layer->set_property_tree_sequence_number(seq_num); 1723 layer->set_property_tree_sequence_number(seq_num);
1718 }); 1724 });
1719 1725
1720 surface_client_id_ = proto.surface_client_id(); 1726 surface_client_id_ = proto.surface_client_id();
1721 next_surface_sequence_ = proto.next_surface_sequence(); 1727 next_surface_sequence_ = proto.next_surface_sequence();
1722 } 1728 }
1723 1729
1724 } // namespace cc 1730 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698