blob: 940a34ce1cc57dc4cbaf0804e2e4f11c023015e8 [file] [log] [blame]
chaviwa76b2712017-09-20 12:02:26 -07001#pragma once
2
3#include "Transform.h"
4
Robert Carr578038f2018-03-09 12:25:24 -08005#include <functional>
6
chaviwa76b2712017-09-20 12:02:26 -07007namespace android {
8
9class RenderArea {
10public:
chaviw7206d492017-11-10 16:16:12 -080011 RenderArea(uint32_t reqHeight, uint32_t reqWidth,
12 ISurfaceComposer::Rotation rotation = ISurfaceComposer::eRotateNone)
chaviwa76b2712017-09-20 12:02:26 -070013 : 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 Carr578038f2018-03-09 12:25:24 -080027 virtual void render(std::function<void()> drawLayers) { drawLayers(); }
28
chaviwa76b2712017-09-20 12:02:26 -070029 int getReqHeight() const { return mReqHeight; };
30 int getReqWidth() const { return mReqWidth; };
31 Transform::orientation_flags getRotationFlags() const { return mRotationFlags; };
chaviwa76b2712017-09-20 12:02:26 -070032 virtual bool getWideColorSupport() const = 0;
33 virtual android_color_mode_t getActiveColorMode() const = 0;
chaviwa76b2712017-09-20 12:02:26 -070034
35 status_t updateDimensions();
36
37private:
38 uint32_t mReqHeight;
39 uint32_t mReqWidth;
40 Transform::orientation_flags mRotationFlags;
41};
42
Chia-I Wu83ce7c12017-10-19 15:18:55 -070043} // namespace android