blob: fa4df8360f84479cc45d9836d2024c80ff911f9e [file] [log] [blame]
chaviwa76b2712017-09-20 12:02:26 -07001#pragma once
2
3#include "Transform.h"
4
5namespace android {
6
7class RenderArea {
8public:
chaviw7206d492017-11-10 16:16:12 -08009 RenderArea(uint32_t reqHeight, uint32_t reqWidth,
10 ISurfaceComposer::Rotation rotation = ISurfaceComposer::eRotateNone)
chaviwa76b2712017-09-20 12:02:26 -070011 : 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; };
chaviwa76b2712017-09-20 12:02:26 -070028 virtual bool getWideColorSupport() const = 0;
29 virtual android_color_mode_t getActiveColorMode() const = 0;
chaviwa76b2712017-09-20 12:02:26 -070030
31 status_t updateDimensions();
32
33private:
34 uint32_t mReqHeight;
35 uint32_t mReqWidth;
36 Transform::orientation_flags mRotationFlags;
37};
38
Chia-I Wu83ce7c12017-10-19 15:18:55 -070039} // namespace android