blob: bf0707f13bf446ed6b7b4d1407fa3f4e5b7effb5 [file] [log] [blame]
chaviwa76b2712017-09-20 12:02:26 -07001#pragma once
2
Peiyong Linfd997e02018-03-28 15:29:00 -07003#include <ui/GraphicTypes.h>
Peiyong Lina52f0292018-03-14 17:26:31 -07004
chaviwa76b2712017-09-20 12:02:26 -07005#include "Transform.h"
6
Robert Carr578038f2018-03-09 12:25:24 -08007#include <functional>
8
chaviwa76b2712017-09-20 12:02:26 -07009namespace android {
10
11class RenderArea {
12public:
chaviw7206d492017-11-10 16:16:12 -080013 RenderArea(uint32_t reqHeight, uint32_t reqWidth,
14 ISurfaceComposer::Rotation rotation = ISurfaceComposer::eRotateNone)
chaviwa76b2712017-09-20 12:02:26 -070015 : mReqHeight(reqHeight), mReqWidth(reqWidth) {
16 mRotationFlags = Transform::fromRotation(rotation);
17 }
18
19 virtual ~RenderArea() = default;
20
21 virtual const Transform& getTransform() const = 0;
22 virtual Rect getBounds() const = 0;
23 virtual int getHeight() const = 0;
24 virtual int getWidth() const = 0;
25 virtual bool isSecure() const = 0;
26 virtual bool needsFiltering() const = 0;
27 virtual Rect getSourceCrop() const = 0;
28
Robert Carr578038f2018-03-09 12:25:24 -080029 virtual void render(std::function<void()> drawLayers) { drawLayers(); }
30
chaviwa76b2712017-09-20 12:02:26 -070031 int getReqHeight() const { return mReqHeight; };
32 int getReqWidth() const { return mReqWidth; };
33 Transform::orientation_flags getRotationFlags() const { return mRotationFlags; };
chaviwa76b2712017-09-20 12:02:26 -070034 virtual bool getWideColorSupport() const = 0;
Peiyong Linfd997e02018-03-28 15:29:00 -070035 virtual ui::ColorMode getActiveColorMode() const = 0;
chaviwa76b2712017-09-20 12:02:26 -070036
37 status_t updateDimensions();
38
39private:
40 uint32_t mReqHeight;
41 uint32_t mReqWidth;
42 Transform::orientation_flags mRotationFlags;
43};
44
Chia-I Wu83ce7c12017-10-19 15:18:55 -070045} // namespace android