chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "Transform.h" |
| 4 | |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame^] | 5 | #include <functional> |
| 6 | |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 7 | namespace android { |
| 8 | |
| 9 | class RenderArea { |
| 10 | public: |
chaviw | 7206d49 | 2017-11-10 16:16:12 -0800 | [diff] [blame] | 11 | RenderArea(uint32_t reqHeight, uint32_t reqWidth, |
| 12 | ISurfaceComposer::Rotation rotation = ISurfaceComposer::eRotateNone) |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 13 | : mReqHeight(reqHeight), mReqWidth(reqWidth) { |
| 14 | mRotationFlags = Transform::fromRotation(rotation); |
| 15 | } |
| 16 | |
| 17 | virtual ~RenderArea() = default; |
| 18 | |
| 19 | virtual const Transform& getTransform() const = 0; |
| 20 | virtual Rect getBounds() const = 0; |
| 21 | virtual int getHeight() const = 0; |
| 22 | virtual int getWidth() const = 0; |
| 23 | virtual bool isSecure() const = 0; |
| 24 | virtual bool needsFiltering() const = 0; |
| 25 | virtual Rect getSourceCrop() const = 0; |
| 26 | |
Robert Carr | 578038f | 2018-03-09 12:25:24 -0800 | [diff] [blame^] | 27 | virtual void render(std::function<void()> drawLayers) { drawLayers(); } |
| 28 | |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 29 | int getReqHeight() const { return mReqHeight; }; |
| 30 | int getReqWidth() const { return mReqWidth; }; |
| 31 | Transform::orientation_flags getRotationFlags() const { return mRotationFlags; }; |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 32 | virtual bool getWideColorSupport() const = 0; |
| 33 | virtual android_color_mode_t getActiveColorMode() const = 0; |
chaviw | a76b271 | 2017-09-20 12:02:26 -0700 | [diff] [blame] | 34 | |
| 35 | status_t updateDimensions(); |
| 36 | |
| 37 | private: |
| 38 | uint32_t mReqHeight; |
| 39 | uint32_t mReqWidth; |
| 40 | Transform::orientation_flags mRotationFlags; |
| 41 | }; |
| 42 | |
Chia-I Wu | 83ce7c1 | 2017-10-19 15:18:55 -0700 | [diff] [blame] | 43 | } // namespace android |