Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 1 | /* |
| 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 Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame^] | 20 | #include <string> |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 21 | |
| 22 | #include <compositionengine/OutputLayer.h> |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame^] | 23 | #include <compositionengine/impl/OutputLayerCompositionState.h> |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 24 | |
| 25 | namespace android::compositionengine::impl { |
| 26 | |
| 27 | class OutputLayer : public compositionengine::OutputLayer { |
| 28 | public: |
| 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 Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame^] | 37 | const OutputLayerCompositionState& getState() const override; |
| 38 | OutputLayerCompositionState& editState() override; |
| 39 | |
| 40 | void dump(std::string& result) const override; |
| 41 | |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 42 | private: |
| 43 | const compositionengine::Output& mOutput; |
| 44 | std::shared_ptr<compositionengine::Layer> mLayer; |
| 45 | sp<compositionengine::LayerFE> mLayerFE; |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame^] | 46 | |
| 47 | OutputLayerCompositionState mState; |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | std::unique_ptr<compositionengine::OutputLayer> createOutputLayer( |
| 51 | const compositionengine::Output&, std::shared_ptr<compositionengine::Layer>, |
| 52 | sp<compositionengine::LayerFE>); |
| 53 | |
| 54 | } // namespace android::compositionengine::impl |