 Chromium Code Reviews
 Chromium Code Reviews Issue 2456093003:
  Enable more layer_tree_host_unittest for LayerTreeHostRemote.  (Closed)
    
  
    Issue 2456093003:
  Enable more layer_tree_host_unittest for LayerTreeHostRemote.  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 480 void LayerTreeHostRemote::SerializeCurrentState( | 480 void LayerTreeHostRemote::SerializeCurrentState( | 
| 481 proto::LayerTreeHost* layer_tree_host_proto) { | 481 proto::LayerTreeHost* layer_tree_host_proto) { | 
| 482 // We need to serialize only the inputs received from the embedder. | 482 // We need to serialize only the inputs received from the embedder. | 
| 483 const bool inputs_only = true; | 483 const bool inputs_only = true; | 
| 484 | 484 | 
| 485 // Serialize the LayerTree. | 485 // Serialize the LayerTree. | 
| 486 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), | 486 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), | 
| 487 inputs_only); | 487 inputs_only); | 
| 488 | 488 | 
| 489 // Serialize the dirty layers. | 489 // Serialize the dirty layers. | 
| 490 for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) | 490 std::unordered_set<Layer*> layers_need_push_properties; | 
| 491 layers_need_push_properties.swap( | |
| 492 layer_tree_->LayersThatShouldPushProperties()); | |
| 
Khushal
2016/10/28 23:11:50
Do you mind adding a small test for this in layer_
 
xingliu
2016/10/31 18:48:05
Done, make sense. Also tweak UpdateTrackingRemoteC
 | |
| 493 | |
| 494 for (auto* layer : layers_need_push_properties) | |
| 491 layer->ToLayerPropertiesProto( | 495 layer->ToLayerPropertiesProto( | 
| 492 layer_tree_host_proto->mutable_layer_updates(), inputs_only); | 496 layer_tree_host_proto->mutable_layer_updates(), inputs_only); | 
| 493 layer_tree_->LayersThatShouldPushProperties().clear(); | |
| 494 | 497 | 
| 495 std::vector<PictureData> pictures = | 498 std::vector<PictureData> pictures = | 
| 496 engine_picture_cache_->CalculateCacheUpdateAndFlush(); | 499 engine_picture_cache_->CalculateCacheUpdateAndFlush(); | 
| 497 proto::PictureDataVectorToSkPicturesProto( | 500 proto::PictureDataVectorToSkPicturesProto( | 
| 498 pictures, layer_tree_host_proto->mutable_pictures()); | 501 pictures, layer_tree_host_proto->mutable_pictures()); | 
| 499 } | 502 } | 
| 500 | 503 | 
| 501 } // namespace cc | 504 } // namespace cc | 
| OLD | NEW |