David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 1 | /* |
| 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 Pique | 0b785d8 | 2018-12-04 17:25:27 -0800 | [diff] [blame] | 20 | #include <string.h> |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 21 | |
Lloyd Pique | 0b785d8 | 2018-12-04 17:25:27 -0800 | [diff] [blame] | 22 | #include <ui/Fence.h> |
| 23 | #include <utils/StrongPointer.h> |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 24 | |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 25 | #include "DisplayHardware/DisplayIdentification.h" |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 26 | |
| 27 | namespace android { |
| 28 | |
David Sodman | b8af792 | 2017-12-21 15:17:55 -0800 | [diff] [blame] | 29 | class LayerBE; |
| 30 | |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 31 | struct CompositionInfo { |
David Sodman | b8af792 | 2017-12-21 15:17:55 -0800 | [diff] [blame] | 32 | std::string layerName; |
David Sodman | 40a3a5a | 2018-05-16 11:55:52 -0700 | [diff] [blame] | 33 | std::shared_ptr<LayerBE> layer; |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 34 | struct { |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 35 | DisplayId displayId; |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 36 | } hwc; |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | class LayerBE { |
| 40 | public: |
David Sodman | b8af792 | 2017-12-21 15:17:55 -0800 | [diff] [blame] | 41 | friend class Layer; |
| 42 | friend class BufferLayer; |
Marissa Wall | fd66862 | 2018-05-10 10:21:13 -0700 | [diff] [blame] | 43 | friend class BufferQueueLayer; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 44 | friend class BufferStateLayer; |
David Sodman | b8af792 | 2017-12-21 15:17:55 -0800 | [diff] [blame] | 45 | friend class ColorLayer; |
| 46 | friend class SurfaceFlinger; |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 47 | |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 48 | // For unit tests |
| 49 | friend class TestableSurfaceFlinger; |
| 50 | |
David Sodman | 2b727ac | 2017-12-21 14:28:08 -0800 | [diff] [blame] | 51 | LayerBE(Layer* layer, std::string layerName); |
David Sodman | 40a3a5a | 2018-05-16 11:55:52 -0700 | [diff] [blame] | 52 | explicit LayerBE(const LayerBE& layer); |
David Sodman | b8af792 | 2017-12-21 15:17:55 -0800 | [diff] [blame] | 53 | |
| 54 | void onLayerDisplayed(const sp<Fence>& releaseFence); |
David Sodman | b8af792 | 2017-12-21 15:17:55 -0800 | [diff] [blame] | 55 | |
David Sodman | 10a41ff | 2018-08-05 12:14:17 -0700 | [diff] [blame] | 56 | Layer*const mLayer; |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 57 | |
Lloyd Pique | 0b785d8 | 2018-12-04 17:25:27 -0800 | [diff] [blame] | 58 | private: |
David Sodman | af8bab1 | 2017-12-14 15:30:55 -0800 | [diff] [blame] | 59 | CompositionInfo compositionInfo; |
| 60 | }; |
| 61 | |
| 62 | }; // namespace android |
| 63 | |