#ifndef CC_LAYERS_MIRROR_LAYER_IMPL_H_
#define CC_LAYERS_MIRROR_LAYER_IMPL_H_
#include <cstdint>
#include <memory>
#include "base/memory/ptr_util.h"
#include "cc/cc_export.h"
#include "cc/layers/layer_impl.h"
namespace cc {
class CC_EXPORT MirrorLayerImpl : public LayerImpl {
public:
static std::unique_ptr<MirrorLayerImpl> Create(LayerTreeImpl* tree_impl,
int id) {
return base::WrapUnique(new MirrorLayerImpl(tree_impl, id));
}
MirrorLayerImpl(const MirrorLayerImpl&) = delete;
MirrorLayerImpl& operator=(const MirrorLayerImpl&) = delete;
~MirrorLayerImpl() override;
void SetMirroredLayerId(int id) { mirrored_layer_id_ = id; }
int mirrored_layer_id() const { return mirrored_layer_id_; }
mojom::LayerType GetLayerType() const override;
std::unique_ptr<LayerImpl> CreateLayerImpl(
LayerTreeImpl* tree_impl) const override;
void AppendQuads(const AppendQuadsContext& context,
viz::CompositorRenderPass* render_pass,
AppendQuadsData* append_quads_data) override;
void PushPropertiesTo(LayerImpl* layer) override;
gfx::Rect GetDamageRect() const override;
gfx::Rect GetEnclosingVisibleRectInTargetSpace() const override;
protected:
MirrorLayerImpl(LayerTreeImpl* tree_impl, int id);
private:
viz::CompositorRenderPassId mirrored_layer_render_pass_id() const {
return viz::CompositorRenderPassId{
static_cast<uint64_t>(mirrored_layer_id())};
}
int mirrored_layer_id_ = 0;
};
}
#endif