Loading include/gui/BufferQueueProducer.h +4 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ public: // See IGraphicBufferProducer::getLastQueuedBuffer virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence) override; sp<Fence>* outFence, float outTransformMatrix[16]) override; private: // This is required by the IBinder::DeathRecipient interface Loading Loading @@ -227,6 +227,9 @@ private: // since the previous buffer might have already been acquired. sp<Fence> mLastQueueBufferFence; Rect mLastQueuedCrop; uint32_t mLastQueuedTransform; // Take-a-ticket system for ensuring that onFrame* callbacks are called in // the order that frames are queued. While the BufferQueue lock // (mCore->mMutex) is held, a ticket is retained by the producer. After Loading include/gui/GLConsumer.h +6 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,12 @@ public: // functions. void getTransformMatrix(float mtx[16]); // Computes the transform matrix documented by getTransformMatrix // from the BufferItem sub parts. static void computeTransformMatrix(float outTransform[16], const sp<GraphicBuffer>& buf, const Rect& cropRect, uint32_t transform, bool filtering); // getTimestamp retrieves the timestamp associated with the texture image // set by the most recent call to updateTexImage. // Loading include/gui/IGraphicBufferProducer.h +3 −1 Original line number Diff line number Diff line Loading @@ -563,9 +563,11 @@ public: // the queue, outBuffer will be populated with nullptr and outFence will be // populated with Fence::NO_FENCE // // outTransformMatrix is not modified if outBuffer is null. // // Returns NO_ERROR or the status of the Binder transaction virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence) = 0; sp<Fence>* outFence, float outTransformMatrix[16]) = 0; }; // ---------------------------------------------------------------------------- Loading include/gui/Surface.h +2 −1 Original line number Diff line number Diff line Loading @@ -130,8 +130,9 @@ public: bool waitForNextFrame(uint64_t lastFrame, nsecs_t timeout); // See IGraphicBufferProducer::getLastQueuedBuffer // See GLConsumer::getTransformMatrix for outTransformMatrix format status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence); sp<Fence>* outFence, float outTransformMatrix[16]); protected: virtual ~Surface(); Loading libs/gui/BufferQueueProducer.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <gui/BufferItem.h> #include <gui/BufferQueueCore.h> #include <gui/BufferQueueProducer.h> #include <gui/GLConsumer.h> #include <gui/IConsumerListener.h> #include <gui/IGraphicBufferAlloc.h> #include <gui/IProducerListener.h> Loading Loading @@ -923,6 +924,8 @@ status_t BufferQueueProducer::queueBuffer(int slot, mLastQueueBufferFence->waitForever("Throttling EGL Production"); } mLastQueueBufferFence = fence; mLastQueuedCrop = item.mCrop; mLastQueuedTransform = item.mTransform; return NO_ERROR; } Loading Loading @@ -1372,7 +1375,7 @@ status_t BufferQueueProducer::setDequeueTimeout(nsecs_t timeout) { } status_t BufferQueueProducer::getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence) { sp<Fence>* outFence, float outTransformMatrix[16]) { ATRACE_CALL(); BQ_LOGV("getLastQueuedBuffer"); Loading @@ -1386,6 +1389,14 @@ status_t BufferQueueProducer::getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, *outBuffer = mSlots[mCore->mLastQueuedSlot].mGraphicBuffer; *outFence = mLastQueueBufferFence; // Currently only SurfaceFlinger internally ever changes // GLConsumer's filtering mode, so we just use 'true' here as // this is slightly specialized for the current client of this API, // which does want filtering. GLConsumer::computeTransformMatrix(outTransformMatrix, mSlots[mCore->mLastQueuedSlot].mGraphicBuffer, mLastQueuedCrop, mLastQueuedTransform, true /* filter */); return NO_ERROR; } Loading Loading
include/gui/BufferQueueProducer.h +4 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ public: // See IGraphicBufferProducer::getLastQueuedBuffer virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence) override; sp<Fence>* outFence, float outTransformMatrix[16]) override; private: // This is required by the IBinder::DeathRecipient interface Loading Loading @@ -227,6 +227,9 @@ private: // since the previous buffer might have already been acquired. sp<Fence> mLastQueueBufferFence; Rect mLastQueuedCrop; uint32_t mLastQueuedTransform; // Take-a-ticket system for ensuring that onFrame* callbacks are called in // the order that frames are queued. While the BufferQueue lock // (mCore->mMutex) is held, a ticket is retained by the producer. After Loading
include/gui/GLConsumer.h +6 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,12 @@ public: // functions. void getTransformMatrix(float mtx[16]); // Computes the transform matrix documented by getTransformMatrix // from the BufferItem sub parts. static void computeTransformMatrix(float outTransform[16], const sp<GraphicBuffer>& buf, const Rect& cropRect, uint32_t transform, bool filtering); // getTimestamp retrieves the timestamp associated with the texture image // set by the most recent call to updateTexImage. // Loading
include/gui/IGraphicBufferProducer.h +3 −1 Original line number Diff line number Diff line Loading @@ -563,9 +563,11 @@ public: // the queue, outBuffer will be populated with nullptr and outFence will be // populated with Fence::NO_FENCE // // outTransformMatrix is not modified if outBuffer is null. // // Returns NO_ERROR or the status of the Binder transaction virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence) = 0; sp<Fence>* outFence, float outTransformMatrix[16]) = 0; }; // ---------------------------------------------------------------------------- Loading
include/gui/Surface.h +2 −1 Original line number Diff line number Diff line Loading @@ -130,8 +130,9 @@ public: bool waitForNextFrame(uint64_t lastFrame, nsecs_t timeout); // See IGraphicBufferProducer::getLastQueuedBuffer // See GLConsumer::getTransformMatrix for outTransformMatrix format status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence); sp<Fence>* outFence, float outTransformMatrix[16]); protected: virtual ~Surface(); Loading
libs/gui/BufferQueueProducer.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <gui/BufferItem.h> #include <gui/BufferQueueCore.h> #include <gui/BufferQueueProducer.h> #include <gui/GLConsumer.h> #include <gui/IConsumerListener.h> #include <gui/IGraphicBufferAlloc.h> #include <gui/IProducerListener.h> Loading Loading @@ -923,6 +924,8 @@ status_t BufferQueueProducer::queueBuffer(int slot, mLastQueueBufferFence->waitForever("Throttling EGL Production"); } mLastQueueBufferFence = fence; mLastQueuedCrop = item.mCrop; mLastQueuedTransform = item.mTransform; return NO_ERROR; } Loading Loading @@ -1372,7 +1375,7 @@ status_t BufferQueueProducer::setDequeueTimeout(nsecs_t timeout) { } status_t BufferQueueProducer::getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence) { sp<Fence>* outFence, float outTransformMatrix[16]) { ATRACE_CALL(); BQ_LOGV("getLastQueuedBuffer"); Loading @@ -1386,6 +1389,14 @@ status_t BufferQueueProducer::getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, *outBuffer = mSlots[mCore->mLastQueuedSlot].mGraphicBuffer; *outFence = mLastQueueBufferFence; // Currently only SurfaceFlinger internally ever changes // GLConsumer's filtering mode, so we just use 'true' here as // this is slightly specialized for the current client of this API, // which does want filtering. GLConsumer::computeTransformMatrix(outTransformMatrix, mSlots[mCore->mLastQueuedSlot].mGraphicBuffer, mLastQueuedCrop, mLastQueuedTransform, true /* filter */); return NO_ERROR; } Loading