Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 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 <string> |
| 20 | |
| 21 | #include <ui/GraphicTypes.h> |
| 22 | #include <ui/Transform.h> |
| 23 | #include <utils/StrongPointer.h> |
| 24 | |
| 25 | #include "RenderArea.h" |
| 26 | |
| 27 | namespace android { |
| 28 | |
| 29 | class DisplayDevice; |
| 30 | class Layer; |
| 31 | class SurfaceFlinger; |
| 32 | |
| 33 | class LayerRenderArea : public RenderArea { |
| 34 | public: |
Melody Hsu | 50c151a | 2024-05-14 06:11:12 +0000 | [diff] [blame] | 35 | LayerRenderArea(sp<Layer> layer, frontend::LayerSnapshot layerSnapshot, const Rect& crop, |
Vishnu Nair | 96a5aaf | 2024-06-26 17:17:51 -0700 | [diff] [blame] | 36 | ui::Size reqSize, ui::Dataspace reqDataSpace, |
Melody Hsu | 50c151a | 2024-05-14 06:11:12 +0000 | [diff] [blame] | 37 | const ui::Transform& layerTransform, const Rect& layerBufferSize, |
Vishnu Nair | 96a5aaf | 2024-06-26 17:17:51 -0700 | [diff] [blame] | 38 | ftl::Flags<RenderArea::Options> options); |
Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 39 | |
| 40 | const ui::Transform& getTransform() const override; |
Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 41 | bool isSecure() const override; |
Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 42 | sp<const DisplayDevice> getDisplayDevice() const override; |
| 43 | Rect getSourceCrop() const override; |
| 44 | |
Melody Hsu | 50c151a | 2024-05-14 06:11:12 +0000 | [diff] [blame] | 45 | sp<Layer> getParentLayer() const override { return mLayer; } |
| 46 | const frontend::LayerSnapshot* getLayerSnapshot() const override { return &mLayerSnapshot; } |
Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 47 | |
| 48 | private: |
| 49 | const sp<Layer> mLayer; |
Melody Hsu | 50c151a | 2024-05-14 06:11:12 +0000 | [diff] [blame] | 50 | const frontend::LayerSnapshot mLayerSnapshot; |
Vishnu Nair | 36d5f8e | 2023-03-19 13:31:35 -0700 | [diff] [blame] | 51 | const Rect mLayerBufferSize; |
Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 52 | const Rect mCrop; |
| 53 | |
| 54 | ui::Transform mTransform; |
Marin Shalamanov | f6b5d18 | 2020-06-12 02:08:51 +0200 | [diff] [blame] | 55 | }; |
| 56 | |
Robert Carr | 12a3b9b | 2022-03-10 09:55:29 -0800 | [diff] [blame] | 57 | } // namespace android |