Loading services/surfaceflinger/Layer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1173,7 +1173,7 @@ Rect Layer::getBufferSize(const State& /*s*/) const { } if (getTransformToDisplayInverse()) { uint32_t invTransform = SurfaceFlinger::getActiveDisplayRotationFlags(); uint32_t invTransform = SurfaceFlinger::getFrontInternalDisplayRotationFlags(); if (invTransform & ui::Transform::ROT_90) { std::swap(bufWidth, bufHeight); } Loading services/surfaceflinger/LayerFE.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ void LayerFE::prepareBufferStateClientComposition( * the code below applies the primary display's inverse transform to * the texture transform */ uint32_t transform = SurfaceFlinger::getActiveDisplayRotationFlags(); uint32_t transform = SurfaceFlinger::getFrontInternalDisplayRotationFlags(); mat4 tr = inverseOrientation(transform); /** Loading services/surfaceflinger/RegionSamplingThread.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ void RegionSamplingThread::captureSample() { { // TODO(b/159112860): Don't keep sp<DisplayDevice> outside of SF main thread const sp<const DisplayDevice> display = mFlinger.getActiveDisplay(); const sp<const DisplayDevice> display = mFlinger.getFrontInternalDisplay(); displayWeak = display; layerStack = display->getLayerStack(); orientation = ui::Transform::toRotationFlags(display->getOrientation()); Loading services/surfaceflinger/SurfaceFlinger.cpp +70 −74 File changed.Preview size limit exceeded, changes collapsed. Show changes services/surfaceflinger/SurfaceFlinger.h +16 −17 Original line number Diff line number Diff line Loading @@ -342,8 +342,8 @@ public: // TODO (b/281857977): This should be annotated with REQUIRES(kMainThreadContext), but this // would require thread safety annotations throughout the frontend (in particular Layer and // LayerFE). static ui::Transform::RotationFlags getActiveDisplayRotationFlags() { return sActiveDisplayRotationFlags; static ui::Transform::RotationFlags getFrontInternalDisplayRotationFlags() { return sFrontInternalDisplayRotationFlags; } protected: Loading Loading @@ -1034,7 +1034,7 @@ private: sp<DisplayDevice> getPacesetterDisplayLocked() REQUIRES(mStateLock) { if (!FlagManager::getInstance().pacesetter_selection()) { return getActiveDisplayLocked(); return getFrontInternalDisplayLocked(); } return getDisplayDeviceLocked(mScheduler->getPacesetterDisplayId()); } Loading @@ -1044,17 +1044,17 @@ private: return getPacesetterDisplayLocked(); } sp<const DisplayDevice> getActiveDisplayLocked() const REQUIRES(mStateLock) { return const_cast<SurfaceFlinger*>(this)->getActiveDisplayLocked(); sp<const DisplayDevice> getFrontInternalDisplayLocked() const REQUIRES(mStateLock) { return const_cast<SurfaceFlinger*>(this)->getFrontInternalDisplayLocked(); } sp<DisplayDevice> getActiveDisplayLocked() REQUIRES(mStateLock) { return getDisplayDeviceLocked(mActiveDisplayId); sp<DisplayDevice> getFrontInternalDisplayLocked() REQUIRES(mStateLock) { return getDisplayDeviceLocked(mFrontInternalDisplayId); } sp<const DisplayDevice> getActiveDisplay() const EXCLUDES(mStateLock) { sp<const DisplayDevice> getFrontInternalDisplay() const EXCLUDES(mStateLock) { Mutex::Autolock lock(mStateLock); return getActiveDisplayLocked(); return getFrontInternalDisplayLocked(); } using DisplayDeviceAndSnapshot = std::pair<sp<DisplayDevice>, display::DisplaySnapshotRef>; Loading Loading @@ -1200,14 +1200,13 @@ private: void releaseVirtualDisplay(VirtualDisplayIdVariant displayId); void releaseVirtualDisplaySnapshot(VirtualDisplayId displayId); // Returns a display other than `mActiveDisplayId` that can be activated, if any. sp<DisplayDevice> getActivatableDisplay() const REQUIRES(mStateLock, kMainThreadContext); sp<DisplayDevice> findFrontInternalDisplay() const REQUIRES(mStateLock, kMainThreadContext); void onActiveDisplayChangedLocked(const DisplayDevice* inactiveDisplayPtr, const DisplayDevice& activeDisplay) void onNewFrontInternalDisplay(const DisplayDevice* oldFrontInternalDisplayPtr, const DisplayDevice& newFrontInternalDisplay) REQUIRES(mStateLock, kMainThreadContext); void onActiveDisplaySizeChanged(const DisplayDevice&); void onFrontInternalDisplaySizeChanged(const DisplayDevice&); /* * Debugging & dumpsys Loading Loading @@ -1403,7 +1402,7 @@ private: GUARDED_BY(mVirtualDisplaysMutex); // The inner or outer display for foldables, while unfolded or folded, respectively. std::atomic<PhysicalDisplayId> mActiveDisplayId; std::atomic<PhysicalDisplayId> mFrontInternalDisplayId; display::DisplayModeController mDisplayModeController; Loading Loading @@ -1513,11 +1512,11 @@ private: ActivePictureTracker::Listeners mActivePictureListenersToAdd GUARDED_BY(mStateLock); ActivePictureTracker::Listeners mActivePictureListenersToRemove GUARDED_BY(mStateLock); std::atomic<ui::Transform::RotationFlags> mActiveDisplayTransformHint; std::atomic<ui::Transform::RotationFlags> mFrontInternalDisplayTransformHint; // Must only be accessed on the main thread. // TODO (b/259407931): Remove. static ui::Transform::RotationFlags sActiveDisplayRotationFlags; static ui::Transform::RotationFlags sFrontInternalDisplayRotationFlags; bool isRefreshRateOverlayEnabled() const REQUIRES(mStateLock) { return hasDisplay( Loading Loading
services/surfaceflinger/Layer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1173,7 +1173,7 @@ Rect Layer::getBufferSize(const State& /*s*/) const { } if (getTransformToDisplayInverse()) { uint32_t invTransform = SurfaceFlinger::getActiveDisplayRotationFlags(); uint32_t invTransform = SurfaceFlinger::getFrontInternalDisplayRotationFlags(); if (invTransform & ui::Transform::ROT_90) { std::swap(bufWidth, bufHeight); } Loading
services/surfaceflinger/LayerFE.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ void LayerFE::prepareBufferStateClientComposition( * the code below applies the primary display's inverse transform to * the texture transform */ uint32_t transform = SurfaceFlinger::getActiveDisplayRotationFlags(); uint32_t transform = SurfaceFlinger::getFrontInternalDisplayRotationFlags(); mat4 tr = inverseOrientation(transform); /** Loading
services/surfaceflinger/RegionSamplingThread.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ void RegionSamplingThread::captureSample() { { // TODO(b/159112860): Don't keep sp<DisplayDevice> outside of SF main thread const sp<const DisplayDevice> display = mFlinger.getActiveDisplay(); const sp<const DisplayDevice> display = mFlinger.getFrontInternalDisplay(); displayWeak = display; layerStack = display->getLayerStack(); orientation = ui::Transform::toRotationFlags(display->getOrientation()); Loading
services/surfaceflinger/SurfaceFlinger.cpp +70 −74 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/surfaceflinger/SurfaceFlinger.h +16 −17 Original line number Diff line number Diff line Loading @@ -342,8 +342,8 @@ public: // TODO (b/281857977): This should be annotated with REQUIRES(kMainThreadContext), but this // would require thread safety annotations throughout the frontend (in particular Layer and // LayerFE). static ui::Transform::RotationFlags getActiveDisplayRotationFlags() { return sActiveDisplayRotationFlags; static ui::Transform::RotationFlags getFrontInternalDisplayRotationFlags() { return sFrontInternalDisplayRotationFlags; } protected: Loading Loading @@ -1034,7 +1034,7 @@ private: sp<DisplayDevice> getPacesetterDisplayLocked() REQUIRES(mStateLock) { if (!FlagManager::getInstance().pacesetter_selection()) { return getActiveDisplayLocked(); return getFrontInternalDisplayLocked(); } return getDisplayDeviceLocked(mScheduler->getPacesetterDisplayId()); } Loading @@ -1044,17 +1044,17 @@ private: return getPacesetterDisplayLocked(); } sp<const DisplayDevice> getActiveDisplayLocked() const REQUIRES(mStateLock) { return const_cast<SurfaceFlinger*>(this)->getActiveDisplayLocked(); sp<const DisplayDevice> getFrontInternalDisplayLocked() const REQUIRES(mStateLock) { return const_cast<SurfaceFlinger*>(this)->getFrontInternalDisplayLocked(); } sp<DisplayDevice> getActiveDisplayLocked() REQUIRES(mStateLock) { return getDisplayDeviceLocked(mActiveDisplayId); sp<DisplayDevice> getFrontInternalDisplayLocked() REQUIRES(mStateLock) { return getDisplayDeviceLocked(mFrontInternalDisplayId); } sp<const DisplayDevice> getActiveDisplay() const EXCLUDES(mStateLock) { sp<const DisplayDevice> getFrontInternalDisplay() const EXCLUDES(mStateLock) { Mutex::Autolock lock(mStateLock); return getActiveDisplayLocked(); return getFrontInternalDisplayLocked(); } using DisplayDeviceAndSnapshot = std::pair<sp<DisplayDevice>, display::DisplaySnapshotRef>; Loading Loading @@ -1200,14 +1200,13 @@ private: void releaseVirtualDisplay(VirtualDisplayIdVariant displayId); void releaseVirtualDisplaySnapshot(VirtualDisplayId displayId); // Returns a display other than `mActiveDisplayId` that can be activated, if any. sp<DisplayDevice> getActivatableDisplay() const REQUIRES(mStateLock, kMainThreadContext); sp<DisplayDevice> findFrontInternalDisplay() const REQUIRES(mStateLock, kMainThreadContext); void onActiveDisplayChangedLocked(const DisplayDevice* inactiveDisplayPtr, const DisplayDevice& activeDisplay) void onNewFrontInternalDisplay(const DisplayDevice* oldFrontInternalDisplayPtr, const DisplayDevice& newFrontInternalDisplay) REQUIRES(mStateLock, kMainThreadContext); void onActiveDisplaySizeChanged(const DisplayDevice&); void onFrontInternalDisplaySizeChanged(const DisplayDevice&); /* * Debugging & dumpsys Loading Loading @@ -1403,7 +1402,7 @@ private: GUARDED_BY(mVirtualDisplaysMutex); // The inner or outer display for foldables, while unfolded or folded, respectively. std::atomic<PhysicalDisplayId> mActiveDisplayId; std::atomic<PhysicalDisplayId> mFrontInternalDisplayId; display::DisplayModeController mDisplayModeController; Loading Loading @@ -1513,11 +1512,11 @@ private: ActivePictureTracker::Listeners mActivePictureListenersToAdd GUARDED_BY(mStateLock); ActivePictureTracker::Listeners mActivePictureListenersToRemove GUARDED_BY(mStateLock); std::atomic<ui::Transform::RotationFlags> mActiveDisplayTransformHint; std::atomic<ui::Transform::RotationFlags> mFrontInternalDisplayTransformHint; // Must only be accessed on the main thread. // TODO (b/259407931): Remove. static ui::Transform::RotationFlags sActiveDisplayRotationFlags; static ui::Transform::RotationFlags sFrontInternalDisplayRotationFlags; bool isRefreshRateOverlayEnabled() const REQUIRES(mStateLock) { return hasDisplay( Loading