blob: aaa758ea6fe01c6daecc0d171d7f8b02ae0f68a1 [file] [log] [blame]
Lloyd Piquefeb73d72018-12-04 17:23:44 -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/CompositionEngine.h>
18#include <compositionengine/LayerCreationArgs.h>
19#include <compositionengine/LayerFE.h>
20#include <compositionengine/impl/Layer.h>
21
22namespace android::compositionengine {
23
24Layer::~Layer() = default;
25
26namespace impl {
27
28std::shared_ptr<compositionengine::Layer> createLayer(
29 const compositionengine::CompositionEngine& compositionEngine,
30 compositionengine::LayerCreationArgs&& args) {
31 return std::make_shared<Layer>(compositionEngine, std::move(args));
32}
33
34Layer::Layer(const CompositionEngine& compositionEngine, LayerCreationArgs&& args)
35 : mCompositionEngine(compositionEngine), mLayerFE(args.layerFE) {
36 static_cast<void>(mCompositionEngine); // Temporary use to prevent an unused warning
37}
38
39Layer::~Layer() = default;
40
41sp<LayerFE> Layer::getLayerFE() const {
42 return mLayerFE.promote();
43}
44
45} // namespace impl
46} // namespace android::compositionengine