blob: 78c140316e632bc6c1b4c9fc15c8218190394768 [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
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080017#include <android-base/stringprintf.h>
Lloyd Piquecc01a452018-12-04 17:24:00 -080018#include <compositionengine/Layer.h>
19#include <compositionengine/LayerFE.h>
20#include <compositionengine/Output.h>
21#include <compositionengine/impl/OutputLayer.h>
22
23namespace android::compositionengine {
24
25OutputLayer::~OutputLayer() = default;
26
27namespace impl {
28
29std::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
35OutputLayer::OutputLayer(const Output& output, std::shared_ptr<Layer> layer, sp<LayerFE> layerFE)
36 : mOutput(output), mLayer(layer), mLayerFE(layerFE) {}
37
38OutputLayer::~OutputLayer() = default;
39
40const compositionengine::Output& OutputLayer::getOutput() const {
41 return mOutput;
42}
43
44compositionengine::Layer& OutputLayer::getLayer() const {
45 return *mLayer;
46}
47
48compositionengine::LayerFE& OutputLayer::getLayerFE() const {
49 return *mLayerFE;
50}
51
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080052const OutputLayerCompositionState& OutputLayer::getState() const {
53 return mState;
54}
55
56OutputLayerCompositionState& OutputLayer::editState() {
57 return mState;
58}
59
60void 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 Piquecc01a452018-12-04 17:24:00 -080067} // namespace impl
68} // namespace android::compositionengine