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