Updated native SurfaceControl APIs to reflect their behavior.
Updated setPosition, setCrop, setBufferTransform, and added setScale to native SurfaceControl API. The new functions should be pass through calls to SurfaceComposerClient that sends it to SurfaceFlinger. Test: ASurfaceControlTest Bug: 170765639 Change-Id: I214c5ae998d8f896200f3010cf2de6754d1e8510
This commit is contained in:
parent
e5bb44a832
commit
ccf3e8b9f9
@ -260,8 +260,9 @@ LIBANDROID {
|
||||
ASurfaceTransaction_setHdrMetadata_smpte2086; # introduced=29
|
||||
ASurfaceTransaction_setOnComplete; # introduced=29
|
||||
ASurfaceTransaction_setPosition; # introduced=31
|
||||
ASurfaceTransaction_setSourceRect; # introduced=31
|
||||
ASurfaceTransaction_setTransform; # introduced=31
|
||||
ASurfaceTransaction_setCrop; # introduced=31
|
||||
ASurfaceTransaction_setBufferTransform; # introduced=31
|
||||
ASurfaceTransaction_setScale; # introduced=31
|
||||
ASurfaceTransaction_setVisibility; # introduced=29
|
||||
ASurfaceTransaction_setZOrder; # introduced=29
|
||||
ASystemFontIterator_open; # introduced=29
|
||||
|
@ -459,34 +459,31 @@ void ASurfaceTransaction_setGeometry(ASurfaceTransaction* aSurfaceTransaction,
|
||||
transaction->setTransformToDisplayInverse(surfaceControl, transformToInverseDisplay);
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setSourceRect(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, const ARect& source) {
|
||||
void ASurfaceTransaction_setCrop(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, const ARect& crop) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
CHECK_VALID_RECT(source);
|
||||
CHECK_VALID_RECT(crop);
|
||||
|
||||
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
|
||||
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
|
||||
|
||||
transaction->setCrop(surfaceControl, static_cast<const Rect&>(source));
|
||||
transaction->setCrop(surfaceControl, static_cast<const Rect&>(crop));
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setPosition(ASurfaceTransaction* /* aSurfaceTransaction */,
|
||||
ASurfaceControl* /* aSurfaceControl */,
|
||||
const ARect& /* destination */) {
|
||||
// TODO: Fix this function
|
||||
/* CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
void ASurfaceTransaction_setPosition(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, int32_t x, int32_t y) {
|
||||
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));*/
|
||||
transaction->setPosition(surfaceControl, x, y);
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setTransform(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, int32_t transform) {
|
||||
void ASurfaceTransaction_setBufferTransform(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, int32_t transform) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
|
||||
@ -499,6 +496,19 @@ void ASurfaceTransaction_setTransform(ASurfaceTransaction* aSurfaceTransaction,
|
||||
transaction->setTransformToDisplayInverse(surfaceControl, transformToInverseDisplay);
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setScale(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl, float xScale, float yScale) {
|
||||
CHECK_NOT_NULL(aSurfaceTransaction);
|
||||
CHECK_NOT_NULL(aSurfaceControl);
|
||||
LOG_ALWAYS_FATAL_IF(xScale < 0, "negative value passed in for xScale");
|
||||
LOG_ALWAYS_FATAL_IF(yScale < 0, "negative value passed in for yScale");
|
||||
|
||||
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
|
||||
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
|
||||
|
||||
transaction->setMatrix(surfaceControl, xScale, 0, 0, yScale);
|
||||
}
|
||||
|
||||
void ASurfaceTransaction_setBufferTransparency(ASurfaceTransaction* aSurfaceTransaction,
|
||||
ASurfaceControl* aSurfaceControl,
|
||||
int8_t transparency) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user