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

Side by Side Diff: cc/blimp/layer_tree_host_remote.cc

Issue 2401703002: cc/blimp: Set up the framework for LayerTreeTests in remote mode. (Closed)
Patch Set: Rebase Created 4 years, 2 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/blimp/layer_tree_host_remote.h ('k') | cc/test/layer_tree_host_remote_for_testing.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/blimp/layer_tree_host_remote.h" 5 #include "cc/blimp/layer_tree_host_remote.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/blimp/compositor_proto_state.h" 10 #include "cc/blimp/compositor_proto_state.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 client_->DidCommit(); 422 client_->DidCommit();
423 client_->DidBeginMainFrame(); 423 client_->DidBeginMainFrame();
424 } 424 }
425 425
426 void LayerTreeHostRemote::DispatchDrawAndSwapCallbacks() { 426 void LayerTreeHostRemote::DispatchDrawAndSwapCallbacks() {
427 client_->DidCommitAndDrawFrame(); 427 client_->DidCommitAndDrawFrame();
428 client_->DidCompleteSwapBuffers(); 428 client_->DidCompleteSwapBuffers();
429 } 429 }
430 430
431 void LayerTreeHostRemote::SetTaskRunnerProviderForTesting(
432 std::unique_ptr<TaskRunnerProvider> task_runner_provider) {
433 task_runner_provider_ = std::move(task_runner_provider);
434 }
435
431 void LayerTreeHostRemote::SerializeCurrentState( 436 void LayerTreeHostRemote::SerializeCurrentState(
432 proto::LayerTreeHost* layer_tree_host_proto) { 437 proto::LayerTreeHost* layer_tree_host_proto) {
433 // We need to serialize only the inputs received from the embedder. 438 // We need to serialize only the inputs received from the embedder.
434 const bool inputs_only = true; 439 const bool inputs_only = true;
435 440
436 // Serialize the LayerTree. 441 // Serialize the LayerTree.
437 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), 442 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(),
438 inputs_only); 443 inputs_only);
439 444
440 // Serialize the dirty layers. 445 // Serialize the dirty layers.
441 for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) 446 for (auto* layer : layer_tree_->LayersThatShouldPushProperties())
442 layer->ToLayerPropertiesProto( 447 layer->ToLayerPropertiesProto(
443 layer_tree_host_proto->mutable_layer_updates(), inputs_only); 448 layer_tree_host_proto->mutable_layer_updates(), inputs_only);
444 layer_tree_->LayersThatShouldPushProperties().clear(); 449 layer_tree_->LayersThatShouldPushProperties().clear();
445 450
446 std::vector<PictureData> pictures = 451 std::vector<PictureData> pictures =
447 engine_picture_cache_->CalculateCacheUpdateAndFlush(); 452 engine_picture_cache_->CalculateCacheUpdateAndFlush();
448 proto::PictureDataVectorToSkPicturesProto( 453 proto::PictureDataVectorToSkPicturesProto(
449 pictures, layer_tree_host_proto->mutable_pictures()); 454 pictures, layer_tree_host_proto->mutable_pictures());
450 } 455 }
451 456
452 } // namespace cc 457 } // namespace cc
OLDNEW
« no previous file with comments | « cc/blimp/layer_tree_host_remote.h ('k') | cc/test/layer_tree_host_remote_for_testing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698