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

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

Issue 2456093003: Enable more layer_tree_host_unittest for LayerTreeHostRemote. (Closed)
Patch Set: Added unit test case in LTH remote unittest. Created 4 years, 1 month 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 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/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 void LayerTreeHostRemote::SerializeCurrentState( 481 void LayerTreeHostRemote::SerializeCurrentState(
482 proto::LayerTreeHost* layer_tree_host_proto) { 482 proto::LayerTreeHost* layer_tree_host_proto) {
483 // We need to serialize only the inputs received from the embedder. 483 // We need to serialize only the inputs received from the embedder.
484 const bool inputs_only = true; 484 const bool inputs_only = true;
485 485
486 // Serialize the LayerTree. 486 // Serialize the LayerTree.
487 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), 487 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(),
488 inputs_only); 488 inputs_only);
489 489
490 // Serialize the dirty layers. 490 // Serialize the dirty layers.
491 for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) 491 std::unordered_set<Layer*> layers_need_push_properties;
492 layers_need_push_properties.swap(
493 layer_tree_->LayersThatShouldPushProperties());
494
495 for (auto* layer : layers_need_push_properties)
492 layer->ToLayerPropertiesProto( 496 layer->ToLayerPropertiesProto(
493 layer_tree_host_proto->mutable_layer_updates(), inputs_only); 497 layer_tree_host_proto->mutable_layer_updates(), inputs_only);
494 layer_tree_->LayersThatShouldPushProperties().clear();
495 498
496 std::vector<PictureData> pictures = 499 std::vector<PictureData> pictures =
497 engine_picture_cache_->CalculateCacheUpdateAndFlush(); 500 engine_picture_cache_->CalculateCacheUpdateAndFlush();
498 proto::PictureDataVectorToSkPicturesProto( 501 proto::PictureDataVectorToSkPicturesProto(
499 pictures, layer_tree_host_proto->mutable_pictures()); 502 pictures, layer_tree_host_proto->mutable_pictures());
500 } 503 }
501 504
502 } // namespace cc 505 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698