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 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame^] | 17 | #include <android-base/stringprintf.h> |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 18 | #include <compositionengine/Layer.h> |
| 19 | #include <compositionengine/LayerFE.h> |
| 20 | #include <compositionengine/Output.h> |
| 21 | #include <compositionengine/impl/OutputLayer.h> |
| 22 | |
| 23 | namespace android::compositionengine { |
| 24 | |
| 25 | OutputLayer::~OutputLayer() = default; |
| 26 | |
| 27 | namespace impl { |
| 28 | |
| 29 | std::unique_ptr<compositionengine::OutputLayer> createOutputLayer( |
| 30 | const compositionengine::Output& display, std::shared_ptr<compositionengine::Layer> layer, |
| 31 | sp<compositionengine::LayerFE> layerFE) { |
| 32 | return std::make_unique<OutputLayer>(display, layer, layerFE); |
| 33 | } |
| 34 | |
| 35 | OutputLayer::OutputLayer(const Output& output, std::shared_ptr<Layer> layer, sp<LayerFE> layerFE) |
| 36 | : mOutput(output), mLayer(layer), mLayerFE(layerFE) {} |
| 37 | |
| 38 | OutputLayer::~OutputLayer() = default; |
| 39 | |
| 40 | const compositionengine::Output& OutputLayer::getOutput() const { |
| 41 | return mOutput; |
| 42 | } |
| 43 | |
| 44 | compositionengine::Layer& OutputLayer::getLayer() const { |
| 45 | return *mLayer; |
| 46 | } |
| 47 | |
| 48 | compositionengine::LayerFE& OutputLayer::getLayerFE() const { |
| 49 | return *mLayerFE; |
| 50 | } |
| 51 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame^] | 52 | const OutputLayerCompositionState& OutputLayer::getState() const { |
| 53 | return mState; |
| 54 | } |
| 55 | |
| 56 | OutputLayerCompositionState& OutputLayer::editState() { |
| 57 | return mState; |
| 58 | } |
| 59 | |
| 60 | void OutputLayer::dump(std::string& out) const { |
| 61 | using android::base::StringAppendF; |
| 62 | |
| 63 | StringAppendF(&out, " Output Layer %p\n", this); |
| 64 | mState.dump(out); |
| 65 | } |
| 66 | |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 67 | } // namespace impl |
| 68 | } // namespace android::compositionengine |