summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RenderArea.h
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2018-06-08 15:11:57 -0700
committer Xin Li <delphij@google.com> 2018-06-08 15:11:57 -0700
commitf11e2bd016d886a333345dea853ebda23a408d5c (patch)
tree905bd4d25d6ab2b046620ff459777d8dcfa5d7de /services/surfaceflinger/RenderArea.h
parentaabd6b7fa343654cd85b3b2da392e424d037d15a (diff)
parent5c947cdf72270fd1f766b2248d526ebc8c7227f6 (diff)
Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master
Bug: 79597307 Change-Id: I6d6bee71b9424eb478780bbfc06b830eb8ded342
Diffstat (limited to 'services/surfaceflinger/RenderArea.h')
-rw-r--r--services/surfaceflinger/RenderArea.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/services/surfaceflinger/RenderArea.h b/services/surfaceflinger/RenderArea.h
new file mode 100644
index 0000000000..96e4b5f48b
--- /dev/null
+++ b/services/surfaceflinger/RenderArea.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#include <ui/GraphicTypes.h>
+
+#include "Transform.h"
+
+#include <functional>
+
+namespace android {
+
+class RenderArea {
+
+public:
+ enum class CaptureFill {CLEAR, OPAQUE};
+
+ static float getCaptureFillValue(CaptureFill captureFill);
+
+ RenderArea(uint32_t reqHeight, uint32_t reqWidth, CaptureFill captureFill,
+ ISurfaceComposer::Rotation rotation = ISurfaceComposer::eRotateNone)
+ : mReqHeight(reqHeight), mReqWidth(reqWidth), mCaptureFill(captureFill) {
+ mRotationFlags = Transform::fromRotation(rotation);
+ }
+
+ virtual ~RenderArea() = default;
+
+ virtual const Transform& getTransform() const = 0;
+ virtual Rect getBounds() const = 0;
+ virtual int getHeight() const = 0;
+ virtual int getWidth() const = 0;
+ virtual bool isSecure() const = 0;
+ virtual bool needsFiltering() const = 0;
+ virtual Rect getSourceCrop() const = 0;
+
+ virtual void render(std::function<void()> drawLayers) { drawLayers(); }
+
+ int getReqHeight() const { return mReqHeight; };
+ int getReqWidth() const { return mReqWidth; };
+ Transform::orientation_flags getRotationFlags() const { return mRotationFlags; };
+ status_t updateDimensions(int displayRotation);
+
+ CaptureFill getCaptureFill() const { return mCaptureFill; };
+
+private:
+ uint32_t mReqHeight;
+ uint32_t mReqWidth;
+ Transform::orientation_flags mRotationFlags;
+ CaptureFill mCaptureFill;
+};
+
+} // namespace android