summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/ScreenCaptureOutput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/ScreenCaptureOutput.cpp')
-rw-r--r--services/surfaceflinger/ScreenCaptureOutput.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/services/surfaceflinger/ScreenCaptureOutput.cpp b/services/surfaceflinger/ScreenCaptureOutput.cpp
index ef9b457fc9..57b0d5e0ea 100644
--- a/services/surfaceflinger/ScreenCaptureOutput.cpp
+++ b/services/surfaceflinger/ScreenCaptureOutput.cpp
@@ -16,6 +16,7 @@
#include "ScreenCaptureOutput.h"
#include "ScreenCaptureRenderSurface.h"
+#include "ui/Rotation.h"
#include <compositionengine/CompositionEngine.h>
#include <compositionengine/DisplayColorProfileCreationArgs.h>
@@ -24,24 +25,6 @@
namespace android {
-namespace {
-
-ui::Size getDisplaySize(ui::Rotation orientation, const Rect& sourceCrop) {
- if (orientation == ui::Rotation::Rotation90 || orientation == ui::Rotation::Rotation270) {
- return {sourceCrop.getHeight(), sourceCrop.getWidth()};
- }
- return {sourceCrop.getWidth(), sourceCrop.getHeight()};
-}
-
-Rect getOrientedDisplaySpaceRect(ui::Rotation orientation, int reqWidth, int reqHeight) {
- if (orientation == ui::Rotation::Rotation90 || orientation == ui::Rotation::Rotation270) {
- return {reqHeight, reqWidth};
- }
- return {reqWidth, reqHeight};
-}
-
-} // namespace
-
std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutputArgs args) {
std::shared_ptr<ScreenCaptureOutput> output = compositionengine::impl::createOutputTemplated<
ScreenCaptureOutput, compositionengine::CompositionEngine, const RenderArea&,
@@ -62,11 +45,10 @@ std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutp
.Build()));
const Rect& sourceCrop = args.renderArea.getSourceCrop();
- const ui::Rotation orientation = ui::Transform::toRotation(args.renderArea.getRotationFlags());
- output->setDisplaySize(getDisplaySize(orientation, sourceCrop));
+ const ui::Rotation orientation = ui::ROTATION_0;
+ output->setDisplaySize({sourceCrop.getWidth(), sourceCrop.getHeight()});
output->setProjection(orientation, sourceCrop,
- getOrientedDisplaySpaceRect(orientation, args.renderArea.getReqWidth(),
- args.renderArea.getReqHeight()));
+ {args.renderArea.getReqWidth(), args.renderArea.getReqHeight()});
{
std::string name = args.regionSampling ? "RegionSampling" : "ScreenCaptureOutput";