blob: 44b9dc92548f89ef6b0b7d325f8d43c94df11e07 [file] [log] [blame]
chaviwa76b2712017-09-20 12:02:26 -07001#pragma once
2
3#include "Transform.h"
4
5namespace android {
6
7class RenderArea {
8public:
9 RenderArea(uint32_t reqHeight, uint32_t reqWidth, ISurfaceComposer::Rotation rotation)
10 : mReqHeight(reqHeight), mReqWidth(reqWidth) {
11 mRotationFlags = Transform::fromRotation(rotation);
12 }
13
14 virtual ~RenderArea() = default;
15
16 virtual const Transform& getTransform() const = 0;
17 virtual Rect getBounds() const = 0;
18 virtual int getHeight() const = 0;
19 virtual int getWidth() const = 0;
20 virtual bool isSecure() const = 0;
21 virtual bool needsFiltering() const = 0;
22 virtual Rect getSourceCrop() const = 0;
23
24 int getReqHeight() const { return mReqHeight; };
25 int getReqWidth() const { return mReqWidth; };
26 Transform::orientation_flags getRotationFlags() const { return mRotationFlags; };
chaviwa76b2712017-09-20 12:02:26 -070027 virtual bool getWideColorSupport() const = 0;
28 virtual android_color_mode_t getActiveColorMode() const = 0;
chaviwa76b2712017-09-20 12:02:26 -070029
30 status_t updateDimensions();
31
32private:
33 uint32_t mReqHeight;
34 uint32_t mReqWidth;
35 Transform::orientation_flags mRotationFlags;
36};
37
Chia-I Wu83ce7c12017-10-19 15:18:55 -070038} // namespace android