| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 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 | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #include "cc/test/push_properties_counting_layer_impl.h" | 
|  | 6 | 
|  | 7 namespace cc { | 
|  | 8 | 
|  | 9 // static | 
|  | 10 std::unique_ptr<PushPropertiesCountingLayerImpl> | 
|  | 11 PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) { | 
|  | 12   return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id)); | 
|  | 13 } | 
|  | 14 | 
|  | 15 PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl( | 
|  | 16     LayerTreeImpl* tree_impl, | 
|  | 17     int id) | 
|  | 18     : LayerImpl(tree_impl, id), push_properties_count_(0) { | 
|  | 19   SetBounds(gfx::Size(1, 1)); | 
|  | 20 } | 
|  | 21 | 
|  | 22 PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default; | 
|  | 23 | 
|  | 24 void PushPropertiesCountingLayerImpl::PushPropertiesTo(LayerImpl* layer) { | 
|  | 25   LayerImpl::PushPropertiesTo(layer); | 
|  | 26   push_properties_count_++; | 
|  | 27   // Push state to the active tree because we can only access it from there. | 
|  | 28   static_cast<PushPropertiesCountingLayerImpl*>(layer)->push_properties_count_ = | 
|  | 29       push_properties_count_; | 
|  | 30 } | 
|  | 31 | 
|  | 32 std::unique_ptr<LayerImpl> PushPropertiesCountingLayerImpl::CreateLayerImpl( | 
|  | 33     LayerTreeImpl* tree_impl) { | 
|  | 34   return PushPropertiesCountingLayerImpl::Create(tree_impl, LayerImpl::id()); | 
|  | 35 } | 
|  | 36 | 
|  | 37 }  // namespace cc | 
| OLD | NEW | 
|---|