blob: e95f3a6d309fa9774c44486a004a367133f72024 [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#include <compositionengine/Layer.h>
18#include <compositionengine/LayerFE.h>
19#include <compositionengine/Output.h>
20#include <compositionengine/impl/OutputLayer.h>
21
22namespace android::compositionengine {
23
24OutputLayer::~OutputLayer() = default;
25
26namespace impl {
27
28std::unique_ptr<compositionengine::OutputLayer> createOutputLayer(
29 const compositionengine::Output& display, std::shared_ptr<compositionengine::Layer> layer,
30 sp<compositionengine::LayerFE> layerFE) {
31 return std::make_unique<OutputLayer>(display, layer, layerFE);
32}
33
34OutputLayer::OutputLayer(const Output& output, std::shared_ptr<Layer> layer, sp<LayerFE> layerFE)
35 : mOutput(output), mLayer(layer), mLayerFE(layerFE) {}
36
37OutputLayer::~OutputLayer() = default;
38
39const compositionengine::Output& OutputLayer::getOutput() const {
40 return mOutput;
41}
42
43compositionengine::Layer& OutputLayer::getLayer() const {
44 return *mLayer;
45}
46
47compositionengine::LayerFE& OutputLayer::getLayerFE() const {
48 return *mLayerFE;
49}
50
51} // namespace impl
52} // namespace android::compositionengine