summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-09-17 23:45:22 -0700
committerMathias Agopian <mathias@google.com>2013-09-17 23:45:22 -0700
commitc1c05de415854eb7a13a16b7e22a22de8515123a (patch)
tree9be282141f29b6c5ec7d6b75bffb59a05d26be42 /libs
parent799f51268006f319f6ae538dca670bfc7f522688 (diff)
downloadframeworks_native-c1c05de415854eb7a13a16b7e22a22de8515123a.zip
frameworks_native-c1c05de415854eb7a13a16b7e22a22de8515123a.tar.gz
frameworks_native-c1c05de415854eb7a13a16b7e22a22de8515123a.tar.bz2
fix camera API 2.0 orientation
we add a flag to ANativeWindow::setBufferTransform that means "apply the inverse rotation of the display this buffer is displayed onto to". Bug: 10804238 Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/BufferQueue.cpp3
-rw-r--r--libs/gui/IGraphicBufferConsumer.cpp8
2 files changed, 8 insertions, 3 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index 50e3079..87d66e2 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -557,7 +557,8 @@ status_t BufferQueue::queueBuffer(int buf,
item.mAcquireCalled = mSlots[buf].mAcquireCalled;
item.mGraphicBuffer = mSlots[buf].mGraphicBuffer;
item.mCrop = crop;
- item.mTransform = transform;
+ item.mTransform = transform & ~NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY;
+ item.mTransformToDisplayInverse = bool(transform & NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY);
item.mScalingMode = scalingMode;
item.mTimestamp = timestamp;
item.mIsAutoTimestamp = isAutoTimestamp;
diff --git a/libs/gui/IGraphicBufferConsumer.cpp b/libs/gui/IGraphicBufferConsumer.cpp
index 4db635c..9574b61 100644
--- a/libs/gui/IGraphicBufferConsumer.cpp
+++ b/libs/gui/IGraphicBufferConsumer.cpp
@@ -47,7 +47,8 @@ IGraphicBufferConsumer::BufferItem::BufferItem() :
mFrameNumber(0),
mBuf(INVALID_BUFFER_SLOT),
mIsDroppable(false),
- mAcquireCalled(false) {
+ mAcquireCalled(false),
+ mTransformToDisplayInverse(false) {
mCrop.makeInvalid();
}
@@ -60,7 +61,8 @@ size_t IGraphicBufferConsumer::BufferItem::getPodSize() const {
sizeof(mFrameNumber) +
sizeof(mBuf) +
sizeof(mIsDroppable) +
- sizeof(mAcquireCalled);
+ sizeof(mAcquireCalled) +
+ sizeof(mTransformToDisplayInverse);
return c;
}
@@ -130,6 +132,7 @@ status_t IGraphicBufferConsumer::BufferItem::flatten(
FlattenableUtils::write(buffer, size, mBuf);
FlattenableUtils::write(buffer, size, mIsDroppable);
FlattenableUtils::write(buffer, size, mAcquireCalled);
+ FlattenableUtils::write(buffer, size, mTransformToDisplayInverse);
return NO_ERROR;
}
@@ -171,6 +174,7 @@ status_t IGraphicBufferConsumer::BufferItem::unflatten(
FlattenableUtils::read(buffer, size, mBuf);
FlattenableUtils::read(buffer, size, mIsDroppable);
FlattenableUtils::read(buffer, size, mAcquireCalled);
+ FlattenableUtils::read(buffer, size, mTransformToDisplayInverse);
return NO_ERROR;
}