blob: 51f7857356d5f658d89c2d4af3754aa81fff9cfa [file] [log] [blame]
David Sodmanaf8bab12017-12-14 15:30:55 -08001/*
2 * Copyright (C) 2018 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#pragma once
18
19#include <stdint.h>
Lloyd Pique0b785d82018-12-04 17:25:27 -080020#include <string.h>
David Sodmanaf8bab12017-12-14 15:30:55 -080021
Lloyd Pique0b785d82018-12-04 17:25:27 -080022#include <ui/Fence.h>
23#include <utils/StrongPointer.h>
David Sodmanaf8bab12017-12-14 15:30:55 -080024
Dominik Laskowski075d3172018-05-24 15:50:06 -070025#include "DisplayHardware/DisplayIdentification.h"
David Sodmanaf8bab12017-12-14 15:30:55 -080026
27namespace android {
28
David Sodmanb8af7922017-12-21 15:17:55 -080029class LayerBE;
30
David Sodmanaf8bab12017-12-14 15:30:55 -080031struct CompositionInfo {
David Sodmanb8af7922017-12-21 15:17:55 -080032 std::string layerName;
David Sodman40a3a5a2018-05-16 11:55:52 -070033 std::shared_ptr<LayerBE> layer;
David Sodmanaf8bab12017-12-14 15:30:55 -080034 struct {
Dominik Laskowski075d3172018-05-24 15:50:06 -070035 DisplayId displayId;
David Sodmanaf8bab12017-12-14 15:30:55 -080036 } hwc;
David Sodmanaf8bab12017-12-14 15:30:55 -080037};
38
39class LayerBE {
40public:
David Sodmanb8af7922017-12-21 15:17:55 -080041 friend class Layer;
42 friend class BufferLayer;
Marissa Wallfd668622018-05-10 10:21:13 -070043 friend class BufferQueueLayer;
Marissa Wall61c58622018-07-18 10:12:20 -070044 friend class BufferStateLayer;
David Sodmanb8af7922017-12-21 15:17:55 -080045 friend class ColorLayer;
46 friend class SurfaceFlinger;
David Sodmanaf8bab12017-12-14 15:30:55 -080047
Lloyd Piqued6b579f2018-04-06 15:29:10 -070048 // For unit tests
49 friend class TestableSurfaceFlinger;
50
David Sodman2b727ac2017-12-21 14:28:08 -080051 LayerBE(Layer* layer, std::string layerName);
David Sodman40a3a5a2018-05-16 11:55:52 -070052 explicit LayerBE(const LayerBE& layer);
David Sodmanb8af7922017-12-21 15:17:55 -080053
54 void onLayerDisplayed(const sp<Fence>& releaseFence);
David Sodmanb8af7922017-12-21 15:17:55 -080055
David Sodman10a41ff2018-08-05 12:14:17 -070056 Layer*const mLayer;
David Sodmanaf8bab12017-12-14 15:30:55 -080057
Lloyd Pique0b785d82018-12-04 17:25:27 -080058private:
David Sodmanaf8bab12017-12-14 15:30:55 -080059 CompositionInfo compositionInfo;
60};
61
62}; // namespace android
63