#include "cc/test/push_properties_counting_layer_impl.h"
#include "base/memory/ptr_util.h"
namespace cc {
std::unique_ptr<PushPropertiesCountingLayerImpl>
PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) {
return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id));
}
PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl(
LayerTreeImpl* tree_impl,
int id)
: LayerImpl(tree_impl, id), push_properties_count_(0) {}
PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default;
void PushPropertiesCountingLayerImpl::PushPropertiesTo(LayerImpl* layer) {
LayerImpl::PushPropertiesTo(layer);
push_properties_count_++;
static_cast<PushPropertiesCountingLayerImpl*>(layer)->push_properties_count_ =
push_properties_count_;
}
std::unique_ptr<LayerImpl> PushPropertiesCountingLayerImpl::CreateLayerImpl(
LayerTreeImpl* tree_impl) const {
return PushPropertiesCountingLayerImpl::Create(tree_impl, LayerImpl::id());
}
}