This source file includes following definitions.
- Create
- surface_id_
- SetSurfaceId
- CreateLayerImpl
- DrawsContent
- PushPropertiesTo
#include "cc/layers/surface_layer.h"
#include "cc/layers/surface_layer_impl.h"
namespace cc {
scoped_refptr<SurfaceLayer> SurfaceLayer::Create() {
return make_scoped_refptr(new SurfaceLayer);
}
SurfaceLayer::SurfaceLayer() : Layer(), surface_id_(0) {}
SurfaceLayer::~SurfaceLayer() {}
void SurfaceLayer::SetSurfaceId(int surface_id) {
surface_id_ = surface_id;
SetNeedsPushProperties();
}
scoped_ptr<LayerImpl> SurfaceLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
return SurfaceLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
}
bool SurfaceLayer::DrawsContent() const {
return surface_id_ && Layer::DrawsContent();
}
void SurfaceLayer::PushPropertiesTo(LayerImpl* layer) {
Layer::PushPropertiesTo(layer);
SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer);
layer_impl->SetSurfaceId(surface_id_);
}
}