Split ASurfaceTransaction_setGeometry api
This CL adds three new methods: setSourceRect, setPosition and setTransform. Test: ASurfaceControlTest Bug: 173671170 Change-Id: I00f05a45bfa2b6e53735d95977d32bdecbce3df1
This commit is contained in:
@@ -258,6 +258,9 @@ LIBANDROID {
|
||||
ASurfaceTransaction_setHdrMetadata_cta861_3; # introduced=29
|
||||
ASurfaceTransaction_setHdrMetadata_smpte2086; # introduced=29
|
||||
ASurfaceTransaction_setOnComplete; # introduced=29
|
||||
ASurfaceTransaction_setPosition; # introduced=31
|
||||
ASurfaceTransaction_setSourceRect; # introduced=31
|
||||
ASurfaceTransaction_setTransform; # introduced=31
|
||||
ASurfaceTransaction_setVisibility; # introduced=29
|
||||
ASurfaceTransaction_setZOrder; # introduced=29
|
||||
ASystemFontIterator_open; # introduced=29
|
||||
@@ -309,4 +312,4 @@ LIBANDROID_PLATFORM {
|
||||
ASurfaceControlStats_getAcquireTime*;
|
||||
ASurfaceControlStats_getFrameNumber*;
|
||||
};
|
||||
} LIBANDROID;
|
||||
} LIBANDROID;
|
||||
|
||||
@@ -446,6 +446,44 @@ void ASurfaceTransaction_setGeometry(ASurfaceTransaction* aSurfaceTransaction,
|
||||
transaction->setTransformToDisplayInverse(surfaceControl, transformToInverseDisplay);
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setSourceRect(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, const ARect& source) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
CHECK_VALID_RECT(source);
|
||||
|
||||
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
|
||||
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
|
||||
|
||||
transaction->setCrop(surfaceControl, static_cast<const Rect&>(source));
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setPosition(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, const ARect& destination) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
CHECK_VALID_RECT(destination);
|
||||
|
||||
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
|
||||
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
|
||||
|
||||
transaction->setFrame(surfaceControl, static_cast<const Rect&>(destination));
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setTransform(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, int32_t transform) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
|
||||
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
|
||||
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
|
||||
|
||||
transaction->setTransform(surfaceControl, transform);
|
||||
bool transformToInverseDisplay = (NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY & transform) ==
|
||||
NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY;
|
||||
transaction->setTransformToDisplayInverse(surfaceControl, transformToInverseDisplay);
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setBufferTransparency(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl,
|
||||
int8_t transparency) {
|
||||
|
||||
Reference in New Issue
Block a user