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.h"
6 
7 #include "cc/test/push_properties_counting_layer_impl.h"
8 #include "cc/trees/layer_tree_host.h"
9 
10 namespace cc {
11 
12 // static
13 scoped_refptr<PushPropertiesCountingLayer>
Create()14 PushPropertiesCountingLayer::Create() {
15   return new PushPropertiesCountingLayer();
16 }
17 
PushPropertiesCountingLayer()18 PushPropertiesCountingLayer::PushPropertiesCountingLayer() {
19   SetBounds(gfx::Size(1, 1));
20 }
21 
22 PushPropertiesCountingLayer::~PushPropertiesCountingLayer() = default;
23 
PushPropertiesTo(LayerImpl * layer)24 void PushPropertiesCountingLayer::PushPropertiesTo(LayerImpl* layer) {
25   Layer::PushPropertiesTo(layer);
26   AddPushPropertiesCount();
27 }
28 
CreateLayerImpl(LayerTreeImpl * tree_impl)29 std::unique_ptr<LayerImpl> PushPropertiesCountingLayer::CreateLayerImpl(
30     LayerTreeImpl* tree_impl) {
31   return PushPropertiesCountingLayerImpl::Create(tree_impl, Layer::id());
32 }
33 
MakePushProperties()34 void PushPropertiesCountingLayer::MakePushProperties() {
35   SetContentsOpaque(!contents_opaque());
36 }
37 
AddPushPropertiesCount()38 void PushPropertiesCountingLayer::AddPushPropertiesCount() {
39   push_properties_count_++;
40 }
41 
42 }  // namespace cc
43