diff options
| author | 2021-05-18 00:31:00 +0000 | |
|---|---|---|
| committer | 2021-05-18 00:31:00 +0000 | |
| commit | 837d98ebfa0553d66b696bcd3de764eb5ecf3066 (patch) | |
| tree | c34d9306f8a12b89fb832a29e61f87527f6924f6 /libs/gui/BLASTBufferQueue.cpp | |
| parent | 4d7a06614c57cf564fa61fc671bbdf7e7c739cff (diff) | |
| parent | 82d07c9e4561ec7adc9340207d25b59b7926c3c9 (diff) | |
Merge "BBQSurface: Give client a chance to observe transform hint earlier" into sc-dev
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
| -rw-r--r-- | libs/gui/BLASTBufferQueue.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index 08800f7a85..a2868c6143 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -317,6 +317,11 @@ void BLASTBufferQueue::releaseBufferCallback(uint64_t graphicBufferId, std::unique_lock _lock{mMutex}; BQA_LOGV("releaseBufferCallback graphicBufferId=%" PRIu64, graphicBufferId); + if (mSurfaceControl != nullptr) { + mTransformHint = mSurfaceControl->getTransformHint(); + mBufferItemConsumer->setTransformHint(mTransformHint); + } + auto it = mSubmitted.find(graphicBufferId); if (it == mSubmitted.end()) { BQA_LOGE("ERROR: releaseBufferCallback without corresponding submitted buffer %" PRIu64, @@ -596,6 +601,14 @@ public: status_t setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInfo) override { return mBbq->setFrameTimelineInfo(frameTimelineInfo); } + protected: + uint32_t getTransformHint() const override { + if (mStickyTransform == 0 && !transformToDisplayInverse()) { + return mBbq->getLastTransformHint(); + } else { + return 0; + } + } }; // TODO: Can we coalesce this with frame updates? Need to confirm @@ -765,4 +778,12 @@ PixelFormat BLASTBufferQueue::convertBufferFormat(PixelFormat& format) { return convertedFormat; } +uint32_t BLASTBufferQueue::getLastTransformHint() const { + if (mSurfaceControl != nullptr) { + return mSurfaceControl->getTransformHint(); + } else { + return 0; + } +} + } // namespace android |