blob: 5798540792062d8f4b6a845634194582a922813c [file] [log] [blame]
Lloyd Piquecc01a452018-12-04 17:24:00 -08001/*
2 * Copyright 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <memory>
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080020#include <string>
Lloyd Piquecc01a452018-12-04 17:24:00 -080021
22#include <compositionengine/OutputLayer.h>
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080023#include <compositionengine/impl/OutputLayerCompositionState.h>
Lloyd Piquecc01a452018-12-04 17:24:00 -080024
25namespace android::compositionengine::impl {
26
27class OutputLayer : public compositionengine::OutputLayer {
28public:
29 OutputLayer(const compositionengine::Output&, std::shared_ptr<compositionengine::Layer>,
30 sp<compositionengine::LayerFE>);
31 ~OutputLayer() override;
32
33 const compositionengine::Output& getOutput() const override;
34 compositionengine::Layer& getLayer() const override;
35 compositionengine::LayerFE& getLayerFE() const override;
36
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080037 const OutputLayerCompositionState& getState() const override;
38 OutputLayerCompositionState& editState() override;
39
40 void dump(std::string& result) const override;
41
Lloyd Piquecc01a452018-12-04 17:24:00 -080042private:
43 const compositionengine::Output& mOutput;
44 std::shared_ptr<compositionengine::Layer> mLayer;
45 sp<compositionengine::LayerFE> mLayerFE;
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080046
47 OutputLayerCompositionState mState;
Lloyd Piquecc01a452018-12-04 17:24:00 -080048};
49
50std::unique_ptr<compositionengine::OutputLayer> createOutputLayer(
51 const compositionengine::Output&, std::shared_ptr<compositionengine::Layer>,
52 sp<compositionengine::LayerFE>);
53
54} // namespace android::compositionengine::impl