Loading libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ cc_library_static { "android/gui/FocusRequest.aidl", "android/gui/InputApplicationInfo.aidl", "android/gui/IWindowInfosListener.aidl", "android/gui/IWindowInfosReportedListener.aidl", "android/gui/WindowInfo.aidl", "WindowInfo.cpp", ], Loading libs/gui/BLASTBufferQueue.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceCont SurfaceComposerClient::Transaction() .setFlags(surface, layer_state_t::eEnableBackpressure, layer_state_t::eEnableBackpressure) .setApplyToken(mApplyToken) .apply(); mNumAcquired = 0; mNumFrameAvailable = 0; Loading @@ -190,7 +191,7 @@ BLASTBufferQueue::~BLASTBufferQueue() { } void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height, int32_t format) { int32_t format, SurfaceComposerClient::Transaction* outTransaction) { std::unique_lock _lock{mMutex}; if (mFormat != format) { mFormat = format; Loading Loading @@ -227,15 +228,18 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, // We only need to update the scale if we've received at least one buffer. The reason // for this is the scale is calculated based on the requested size and buffer size. // If there's no buffer, the scale will always be 1. SurfaceComposerClient::Transaction* destFrameTransaction = (outTransaction) ? outTransaction : &t; if (mSurfaceControl != nullptr && mLastBufferInfo.hasBuffer) { t.setDestinationFrame(mSurfaceControl, Rect(0, 0, newSize.getWidth(), newSize.getHeight())); destFrameTransaction->setDestinationFrame(mSurfaceControl, Rect(0, 0, newSize.getWidth(), newSize.getHeight())); } applyTransaction = true; } } if (applyTransaction) { t.apply(); t.setApplyToken(mApplyToken).apply(); } } Loading Loading @@ -453,6 +457,9 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { incStrong((void*)transactionCallbackThunk); Rect crop = computeCrop(bufferItem); const bool updateDestinationFrame = bufferItem.mScalingMode == NATIVE_WINDOW_SCALING_MODE_FREEZE || !mLastBufferInfo.hasBuffer; mLastBufferInfo.update(true /* hasBuffer */, bufferItem.mGraphicBuffer->getWidth(), bufferItem.mGraphicBuffer->getHeight(), bufferItem.mTransform, bufferItem.mScalingMode, crop); Loading @@ -470,7 +477,9 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this)); mSurfaceControlsWithPendingCallback.push(mSurfaceControl); if (updateDestinationFrame) { t->setDestinationFrame(mSurfaceControl, Rect(0, 0, mSize.getWidth(), mSize.getHeight())); } t->setBufferCrop(mSurfaceControl, crop); t->setTransform(mSurfaceControl, bufferItem.mTransform); t->setTransformToDisplayInverse(mSurfaceControl, bufferItem.mTransformToDisplayInverse); Loading libs/gui/WindowInfosListenerReporter.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ namespace android { using gui::IWindowInfosReportedListener; using gui::WindowInfo; using gui::WindowInfosListener; Loading Loading @@ -64,7 +65,8 @@ status_t WindowInfosListenerReporter::removeWindowInfosListener( } binder::Status WindowInfosListenerReporter::onWindowInfosChanged( const std::vector<WindowInfo>& windowInfos) { const std::vector<WindowInfo>& windowInfos, const sp<IWindowInfosReportedListener>& windowInfosReportedListener) { std::unordered_set<sp<WindowInfosListener>, ISurfaceComposer::SpHash<WindowInfosListener>> windowInfosListeners; Loading @@ -79,6 +81,10 @@ binder::Status WindowInfosListenerReporter::onWindowInfosChanged( listener->onWindowInfosChanged(windowInfos); } if (windowInfosReportedListener) { windowInfosReportedListener->onWindowInfosReported(); } return binder::Status::ok(); } Loading libs/gui/android/gui/IWindowInfosListener.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ package android.gui; import android.gui.IWindowInfosReportedListener; import android.gui.WindowInfo; /** @hide */ oneway interface IWindowInfosListener { void onWindowInfosChanged(in WindowInfo[] windowInfos); void onWindowInfosChanged(in WindowInfo[] windowInfos, in @nullable IWindowInfosReportedListener windowInfosReportedListener); } libs/input/android/os/ISetInputWindowsListener.aidl→libs/gui/android/gui/IWindowInfosReportedListener.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -14,10 +14,10 @@ * limitations under the License. */ package android.os; package android.gui; /** @hide */ oneway interface ISetInputWindowsListener oneway interface IWindowInfosReportedListener { void onSetInputWindowsFinished(); void onWindowInfosReported(); } Loading
libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ cc_library_static { "android/gui/FocusRequest.aidl", "android/gui/InputApplicationInfo.aidl", "android/gui/IWindowInfosListener.aidl", "android/gui/IWindowInfosReportedListener.aidl", "android/gui/WindowInfo.aidl", "WindowInfo.cpp", ], Loading
libs/gui/BLASTBufferQueue.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceCont SurfaceComposerClient::Transaction() .setFlags(surface, layer_state_t::eEnableBackpressure, layer_state_t::eEnableBackpressure) .setApplyToken(mApplyToken) .apply(); mNumAcquired = 0; mNumFrameAvailable = 0; Loading @@ -190,7 +191,7 @@ BLASTBufferQueue::~BLASTBufferQueue() { } void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height, int32_t format) { int32_t format, SurfaceComposerClient::Transaction* outTransaction) { std::unique_lock _lock{mMutex}; if (mFormat != format) { mFormat = format; Loading Loading @@ -227,15 +228,18 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, // We only need to update the scale if we've received at least one buffer. The reason // for this is the scale is calculated based on the requested size and buffer size. // If there's no buffer, the scale will always be 1. SurfaceComposerClient::Transaction* destFrameTransaction = (outTransaction) ? outTransaction : &t; if (mSurfaceControl != nullptr && mLastBufferInfo.hasBuffer) { t.setDestinationFrame(mSurfaceControl, Rect(0, 0, newSize.getWidth(), newSize.getHeight())); destFrameTransaction->setDestinationFrame(mSurfaceControl, Rect(0, 0, newSize.getWidth(), newSize.getHeight())); } applyTransaction = true; } } if (applyTransaction) { t.apply(); t.setApplyToken(mApplyToken).apply(); } } Loading Loading @@ -453,6 +457,9 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { incStrong((void*)transactionCallbackThunk); Rect crop = computeCrop(bufferItem); const bool updateDestinationFrame = bufferItem.mScalingMode == NATIVE_WINDOW_SCALING_MODE_FREEZE || !mLastBufferInfo.hasBuffer; mLastBufferInfo.update(true /* hasBuffer */, bufferItem.mGraphicBuffer->getWidth(), bufferItem.mGraphicBuffer->getHeight(), bufferItem.mTransform, bufferItem.mScalingMode, crop); Loading @@ -470,7 +477,9 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this)); mSurfaceControlsWithPendingCallback.push(mSurfaceControl); if (updateDestinationFrame) { t->setDestinationFrame(mSurfaceControl, Rect(0, 0, mSize.getWidth(), mSize.getHeight())); } t->setBufferCrop(mSurfaceControl, crop); t->setTransform(mSurfaceControl, bufferItem.mTransform); t->setTransformToDisplayInverse(mSurfaceControl, bufferItem.mTransformToDisplayInverse); Loading
libs/gui/WindowInfosListenerReporter.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ namespace android { using gui::IWindowInfosReportedListener; using gui::WindowInfo; using gui::WindowInfosListener; Loading Loading @@ -64,7 +65,8 @@ status_t WindowInfosListenerReporter::removeWindowInfosListener( } binder::Status WindowInfosListenerReporter::onWindowInfosChanged( const std::vector<WindowInfo>& windowInfos) { const std::vector<WindowInfo>& windowInfos, const sp<IWindowInfosReportedListener>& windowInfosReportedListener) { std::unordered_set<sp<WindowInfosListener>, ISurfaceComposer::SpHash<WindowInfosListener>> windowInfosListeners; Loading @@ -79,6 +81,10 @@ binder::Status WindowInfosListenerReporter::onWindowInfosChanged( listener->onWindowInfosChanged(windowInfos); } if (windowInfosReportedListener) { windowInfosReportedListener->onWindowInfosReported(); } return binder::Status::ok(); } Loading
libs/gui/android/gui/IWindowInfosListener.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ package android.gui; import android.gui.IWindowInfosReportedListener; import android.gui.WindowInfo; /** @hide */ oneway interface IWindowInfosListener { void onWindowInfosChanged(in WindowInfo[] windowInfos); void onWindowInfosChanged(in WindowInfo[] windowInfos, in @nullable IWindowInfosReportedListener windowInfosReportedListener); }
libs/input/android/os/ISetInputWindowsListener.aidl→libs/gui/android/gui/IWindowInfosReportedListener.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -14,10 +14,10 @@ * limitations under the License. */ package android.os; package android.gui; /** @hide */ oneway interface ISetInputWindowsListener oneway interface IWindowInfosReportedListener { void onSetInputWindowsFinished(); void onWindowInfosReported(); }