blob: ecacaeee9cf8fab319aed5483bfc49d022fcd735 [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
Lloyd Pique0b785d82018-12-04 17:25:27 -080017#include <android-base/stringprintf.h>
Lloyd Piquefeb73d72018-12-04 17:23:44 -080018#include <compositionengine/LayerFE.h>
Lloyd Piquea38ea7e2019-04-16 18:10:26 -070019#include <compositionengine/LayerFECompositionState.h>
Lloyd Piquefeb73d72018-12-04 17:23:44 -080020#include <compositionengine/impl/Layer.h>
21
22namespace android::compositionengine {
23
24Layer::~Layer() = default;
25
26namespace impl {
27
Lloyd Piquea38ea7e2019-04-16 18:10:26 -070028std::shared_ptr<Layer> createLayer(const LayerCreationArgs& args) {
29 return compositionengine::impl::createLayerTemplated<Layer>(args);
Lloyd Piquefeb73d72018-12-04 17:23:44 -080030}
31
32Layer::~Layer() = default;
33
Lloyd Pique0b785d82018-12-04 17:25:27 -080034void Layer::dump(std::string& out) const {
Lloyd Pique207def92019-02-28 16:09:52 -080035 auto layerFE = getLayerFE();
36 android::base::StringAppendF(&out, "* compositionengine::Layer %p (%s)\n", this,
37 layerFE ? layerFE->getDebugName() : "<unknown>");
Lloyd Pique9755fb72019-03-26 14:44:40 -070038 out.append(" frontend:\n");
Lloyd Piquea38ea7e2019-04-16 18:10:26 -070039 dumpFEState(out);
Lloyd Pique0b785d82018-12-04 17:25:27 -080040}
41
Lloyd Piquefeb73d72018-12-04 17:23:44 -080042} // namespace impl
43} // namespace android::compositionengine