Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b6559c7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "ui: Deduplicate rotation types"

parents 4991c597 718f9601
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -606,7 +606,7 @@ void Replayer::setDisplayProjection(SurfaceComposerClient::Transaction& t,
            pc.viewport().bottom());
    Rect frame = Rect(pc.frame().left(), pc.frame().top(), pc.frame().right(), pc.frame().bottom());

    t.setDisplayProjection(mDisplays[id], pc.orientation(), viewport, frame);
    t.setDisplayProjection(mDisplays[id], ui::toRotation(pc.orientation()), viewport, frame);
}

status_t Replayer::createSurfaceControl(
+10 −3
Original line number Diff line number Diff line
@@ -17,16 +17,23 @@
#ifndef _LIBINPUT_DISPLAY_VIEWPORT_H
#define _LIBINPUT_DISPLAY_VIEWPORT_H

#include <cinttypes>
#include <optional>

#include <android-base/stringprintf.h>
#include <ui/DisplayInfo.h>
#include <input/Input.h>
#include <inttypes.h>
#include <optional>

using android::base::StringPrintf;

namespace android {

enum {
    DISPLAY_ORIENTATION_0 = 0,
    DISPLAY_ORIENTATION_90 = 1,
    DISPLAY_ORIENTATION_180 = 2,
    DISPLAY_ORIENTATION_270 = 3
};

/**
 * Describes the different type of viewports supported by input flinger.
 * Keep in sync with values in InputManagerService.java.
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@

#include <stdint.h>
#include <sys/time.h>
#include <ui/DisplayInfo.h>
#include <vector>

namespace android {
+4 −5
Original line number Diff line number Diff line
@@ -110,10 +110,10 @@ public:
    }

    virtual status_t captureScreen(const sp<IBinder>& display, sp<GraphicBuffer>* outBuffer,
                                   bool& outCapturedSecureLayers, const ui::Dataspace reqDataspace,
                                   const ui::PixelFormat reqPixelFormat, Rect sourceCrop,
                                   bool& outCapturedSecureLayers, ui::Dataspace reqDataspace,
                                   ui::PixelFormat reqPixelFormat, const Rect& sourceCrop,
                                   uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform,
                                   ISurfaceComposer::Rotation rotation, bool captureSecureLayers) {
                                   ui::Rotation rotation, bool captureSecureLayers) {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeStrongBinder(display);
@@ -1214,8 +1214,7 @@ status_t BnSurfaceComposer::onTransact(
            bool capturedSecureLayers = false;
            status_t res = captureScreen(display, &outBuffer, capturedSecureLayers, reqDataspace,
                                         reqPixelFormat, sourceCrop, reqWidth, reqHeight,
                                         useIdentityTransform,
                                         static_cast<ISurfaceComposer::Rotation>(rotation),
                                         useIdentityTransform, ui::toRotation(rotation),
                                         captureSecureLayers);

            reply->writeInt32(res);
+2 −3
Original line number Diff line number Diff line
@@ -203,7 +203,6 @@ status_t ComposerState::read(const Parcel& input) {
DisplayState::DisplayState() :
    what(0),
    layerStack(0),
    orientation(eOrientationDefault),
    viewport(Rect::EMPTY_RECT),
    frame(Rect::EMPTY_RECT),
    width(0),
@@ -215,7 +214,7 @@ status_t DisplayState::write(Parcel& output) const {
    output.writeStrongBinder(IInterface::asBinder(surface));
    output.writeUint32(what);
    output.writeUint32(layerStack);
    output.writeUint32(orientation);
    output.writeUint32(toRotationInt(orientation));
    output.write(viewport);
    output.write(frame);
    output.writeUint32(width);
@@ -228,7 +227,7 @@ status_t DisplayState::read(const Parcel& input) {
    surface = interface_cast<IGraphicBufferProducer>(input.readStrongBinder());
    what = input.readUint32();
    layerStack = input.readUint32();
    orientation = input.readUint32();
    orientation = ui::toRotation(input.readUint32());
    input.read(viewport);
    input.read(frame);
    width = input.readUint32();
Loading