diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2014-06-27 15:51:55 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2014-07-14 22:14:32 +0000 |
commit | 1681d95989271f3a9ac0dbb93d10e4a29f2b4444 (patch) | |
tree | 52e23db3604b9b52d3f4d62324f279cb8942de69 /include/gui | |
parent | f3381cf1a645f857dccad9a4369ae23054e9d7d4 (diff) | |
download | frameworks_native-1681d95989271f3a9ac0dbb93d10e4a29f2b4444.zip frameworks_native-1681d95989271f3a9ac0dbb93d10e4a29f2b4444.tar.gz frameworks_native-1681d95989271f3a9ac0dbb93d10e4a29f2b4444.tar.bz2 |
Add sticky transform to surfaceflinger.
Bug: 15116722
- Adds a sticky transform field that can be set from a
SurfaceFlinger client Surface. This transform is
added to any transform applied to the Surface.
Change-Id: Idaa4311dfd027b2d2b8ea5e2c6cba2da5779d753
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/BufferQueueProducer.h | 2 | ||||
-rw-r--r-- | include/gui/IGraphicBufferProducer.h | 15 | ||||
-rw-r--r-- | include/gui/Surface.h | 8 |
3 files changed, 21 insertions, 4 deletions
diff --git a/include/gui/BufferQueueProducer.h b/include/gui/BufferQueueProducer.h index fe8a308..3fc5de2 100644 --- a/include/gui/BufferQueueProducer.h +++ b/include/gui/BufferQueueProducer.h @@ -195,6 +195,8 @@ private: // most updates). String8 mConsumerName; + uint32_t mStickyTransform; + }; // class BufferQueueProducer } // namespace android diff --git a/include/gui/IGraphicBufferProducer.h b/include/gui/IGraphicBufferProducer.h index 9b96b2b..4e9e810 100644 --- a/include/gui/IGraphicBufferProducer.h +++ b/include/gui/IGraphicBufferProducer.h @@ -273,15 +273,18 @@ public: // async - if the buffer is queued in asynchronous mode // fence - a fence that the consumer must wait on before reading the buffer, // set this to Fence::NO_FENCE if the buffer is ready immediately + // sticky - the sticky transform set in Surface (only used by the LEGACY + // camera mode). inline QueueBufferInput(int64_t timestamp, bool isAutoTimestamp, const Rect& crop, int scalingMode, uint32_t transform, bool async, - const sp<Fence>& fence) + const sp<Fence>& fence, uint32_t sticky = 0) : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), crop(crop), - scalingMode(scalingMode), transform(transform), async(async), - fence(fence) { } + scalingMode(scalingMode), transform(transform), stickyTransform(sticky), + async(async), fence(fence) { } inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp, Rect* outCrop, int* outScalingMode, uint32_t* outTransform, - bool* outAsync, sp<Fence>* outFence) const { + bool* outAsync, sp<Fence>* outFence, + uint32_t* outStickyTransform = NULL) const { *outTimestamp = timestamp; *outIsAutoTimestamp = bool(isAutoTimestamp); *outCrop = crop; @@ -289,6 +292,9 @@ public: *outTransform = transform; *outAsync = bool(async); *outFence = fence; + if (outStickyTransform != NULL) { + *outStickyTransform = stickyTransform; + } } // Flattenable protocol @@ -303,6 +309,7 @@ public: Rect crop; int scalingMode; uint32_t transform; + uint32_t stickyTransform; int async; sp<Fence> fence; }; diff --git a/include/gui/Surface.h b/include/gui/Surface.h index dcfe74f..35ab7f6 100644 --- a/include/gui/Surface.h +++ b/include/gui/Surface.h @@ -138,6 +138,7 @@ private: int dispatchSetBuffersFormat(va_list args); int dispatchSetScalingMode(va_list args); int dispatchSetBuffersTransform(va_list args); + int dispatchSetBuffersStickyTransform(va_list args); int dispatchSetBuffersTimestamp(va_list args); int dispatchSetCrop(va_list args); int dispatchSetPostTransformCrop(va_list args); @@ -163,6 +164,7 @@ protected: virtual int setBuffersFormat(int format); virtual int setScalingMode(int mode); virtual int setBuffersTransform(int transform); + virtual int setBuffersStickyTransform(int transform); virtual int setBuffersTimestamp(int64_t timestamp); virtual int setCrop(Rect const* rect); virtual int setUsage(uint32_t reqUsage); @@ -231,6 +233,12 @@ private: // buffer that gets queued. It is set by calling setTransform. uint32_t mTransform; + // mStickyTransform is a transform that is applied on top of mTransform + // in each buffer that is queued. This is typically used to force the + // compositor to apply a transform, and will prevent the transform hint + // from being set by the compositor. + uint32_t mStickyTransform; + // mDefaultWidth is default width of the buffers, regardless of the // native_window_set_buffers_dimensions call. uint32_t mDefaultWidth; |