Loading libs/gui/include/gui/LayerState.h +9 −3 Original line number Diff line number Diff line Loading @@ -502,12 +502,18 @@ struct DisplayState { Rect layerStackSpaceRect = Rect::EMPTY_RECT; Rect orientedDisplaySpaceRect = Rect::EMPTY_RECT; // Exclusive to virtual displays: The sink surface into which the virtual display is rendered, // and an optional resolution that overrides its default dimensions. sp<IGraphicBufferProducer> surface; // For physical displays, this is the resolution, which must match the active display mode. To // change the resolution, the client must first call SurfaceControl.setDesiredDisplayModeSpecs // with the new DesiredDisplayModeSpecs#defaultMode, then commit the matching width and height. // // For virtual displays, this is an optional resolution that overrides its default dimensions. // uint32_t width = 0; uint32_t height = 0; // For virtual displays, this is the sink surface into which the virtual display is rendered. sp<IGraphicBufferProducer> surface; status_t write(Parcel& output) const; status_t read(const Parcel& input); }; Loading services/surfaceflinger/Display/DisplayModeRequest.h +2 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ namespace android::display { struct DisplayModeRequest { scheduler::FrameRateMode mode; // Whether to emit DisplayEventReceiver::DISPLAY_EVENT_MODE_CHANGE. // Whether to emit DisplayEventReceiver::DISPLAY_EVENT_MODE_CHANGE for a change in refresh rate // or render rate. Ignored for resolution changes, which always emit the event. bool emitEvent = false; // Whether to force the request to be applied, even if the mode is unchanged. Loading services/surfaceflinger/DisplayDevice.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -223,9 +223,7 @@ void DisplayDevice::setFlags(uint32_t flags) { mFlags = flags; } void DisplayDevice::setDisplaySize(int width, int height) { LOG_FATAL_IF(!isVirtual(), "Changing the display size is supported only for virtual displays."); const auto size = ui::Size(width, height); void DisplayDevice::setDisplaySize(ui::Size size) { mCompositionDisplay->setDisplaySize(size); if (mRefreshRateOverlay) { mRefreshRateOverlay->setViewport(size); Loading services/surfaceflinger/DisplayDevice.h +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ public: ui::Size getSize() const { return {getWidth(), getHeight()}; } void setLayerFilter(ui::LayerFilter); void setDisplaySize(int width, int height); void setDisplaySize(ui::Size); void setProjection(ui::Rotation orientation, Rect viewport, Rect frame); void stageBrightness(float brightness) REQUIRES(kMainThreadContext); void persistBrightness(bool needsComposite) REQUIRES(kMainThreadContext); Loading services/surfaceflinger/Scheduler/include/scheduler/FrameRateMode.h +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,10 @@ struct FrameRateMode { } bool operator!=(const FrameRateMode& other) const { return !(*this == other); } bool matchesResolution(const FrameRateMode& other) const { return modePtr->getResolution() == other.modePtr->getResolution(); } }; inline std::string to_string(const FrameRateMode& mode) { Loading Loading
libs/gui/include/gui/LayerState.h +9 −3 Original line number Diff line number Diff line Loading @@ -502,12 +502,18 @@ struct DisplayState { Rect layerStackSpaceRect = Rect::EMPTY_RECT; Rect orientedDisplaySpaceRect = Rect::EMPTY_RECT; // Exclusive to virtual displays: The sink surface into which the virtual display is rendered, // and an optional resolution that overrides its default dimensions. sp<IGraphicBufferProducer> surface; // For physical displays, this is the resolution, which must match the active display mode. To // change the resolution, the client must first call SurfaceControl.setDesiredDisplayModeSpecs // with the new DesiredDisplayModeSpecs#defaultMode, then commit the matching width and height. // // For virtual displays, this is an optional resolution that overrides its default dimensions. // uint32_t width = 0; uint32_t height = 0; // For virtual displays, this is the sink surface into which the virtual display is rendered. sp<IGraphicBufferProducer> surface; status_t write(Parcel& output) const; status_t read(const Parcel& input); }; Loading
services/surfaceflinger/Display/DisplayModeRequest.h +2 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ namespace android::display { struct DisplayModeRequest { scheduler::FrameRateMode mode; // Whether to emit DisplayEventReceiver::DISPLAY_EVENT_MODE_CHANGE. // Whether to emit DisplayEventReceiver::DISPLAY_EVENT_MODE_CHANGE for a change in refresh rate // or render rate. Ignored for resolution changes, which always emit the event. bool emitEvent = false; // Whether to force the request to be applied, even if the mode is unchanged. Loading
services/surfaceflinger/DisplayDevice.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -223,9 +223,7 @@ void DisplayDevice::setFlags(uint32_t flags) { mFlags = flags; } void DisplayDevice::setDisplaySize(int width, int height) { LOG_FATAL_IF(!isVirtual(), "Changing the display size is supported only for virtual displays."); const auto size = ui::Size(width, height); void DisplayDevice::setDisplaySize(ui::Size size) { mCompositionDisplay->setDisplaySize(size); if (mRefreshRateOverlay) { mRefreshRateOverlay->setViewport(size); Loading
services/surfaceflinger/DisplayDevice.h +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ public: ui::Size getSize() const { return {getWidth(), getHeight()}; } void setLayerFilter(ui::LayerFilter); void setDisplaySize(int width, int height); void setDisplaySize(ui::Size); void setProjection(ui::Rotation orientation, Rect viewport, Rect frame); void stageBrightness(float brightness) REQUIRES(kMainThreadContext); void persistBrightness(bool needsComposite) REQUIRES(kMainThreadContext); Loading
services/surfaceflinger/Scheduler/include/scheduler/FrameRateMode.h +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,10 @@ struct FrameRateMode { } bool operator!=(const FrameRateMode& other) const { return !(*this == other); } bool matchesResolution(const FrameRateMode& other) const { return modePtr->getResolution() == other.modePtr->getResolution(); } }; inline std::string to_string(const FrameRateMode& mode) { Loading