Use ui::Rotation in libgui calls

Bug: 144601064
Test: Build
Change-Id: I46d6974e67dcae2d42766f08c899c56dddd795e9
This commit is contained in:
Dominik Laskowski
2019-11-18 20:26:39 -08:00
parent 05528bc690
commit 2a3d9aaebb
3 changed files with 15 additions and 13 deletions

View File

@@ -1113,7 +1113,7 @@ void BootAnimation::handleViewport(nsecs_t timestep) {
SurfaceComposerClient::Transaction t;
t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset)
.setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight));
t.setDisplayProjection(mDisplayToken, 0 /* orientation */, layerStackRect, displayRect);
t.setDisplayProjection(mDisplayToken, ui::ROTATION_0, layerStackRect, displayRect);
t.apply();
mTargetInset = mCurrentInset = 0;

View File

@@ -263,7 +263,8 @@ static jobject nativeScreenshot(JNIEnv* env, jclass clazz,
status_t res = ScreenshotClient::capture(displayToken, dataspace,
ui::PixelFormat::RGBA_8888,
sourceCrop, width, height,
useIdentityTransform, rotation, captureSecureLayers, &buffer, capturedSecureLayers);
useIdentityTransform, ui::toRotation(rotation),
captureSecureLayers, &buffer, capturedSecureLayers);
if (res != NO_ERROR) {
return NULL;
}
@@ -724,7 +725,8 @@ static void nativeSetDisplayProjection(JNIEnv* env, jclass clazz,
{
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
transaction->setDisplayProjection(token, orientation, layerStackRect, displayRect);
transaction->setDisplayProjection(token, static_cast<ui::Rotation>(orientation),
layerStackRect, displayRect);
}
}

View File

@@ -25,16 +25,16 @@ namespace test {
static const int IDENT_DISPLAYEVENT = 1;
static android::DisplayInfo DUMMY_DISPLAY{
1080, // w
1920, // h
320.0, // xdpi
320.0, // ydpi
60.0, // fps
2.0, // density
0, // orientation
false, // secure?
0, // appVsyncOffset
0, // presentationDeadline
1080, // w
1920, // h
320.0, // xdpi
320.0, // ydpi
60.0, // fps
2.0, // density
ui::ROTATION_0, // orientation
false, // secure?
0, // appVsyncOffset
0, // presentationDeadline
};
DisplayInfo getInternalDisplay() {