diff options
Diffstat (limited to 'services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h')
-rw-r--r-- | services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h | 104 |
1 files changed, 48 insertions, 56 deletions
diff --git a/services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h b/services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h index a195e5808a..75a4fec8fb 100644 --- a/services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +++ b/services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h @@ -22,12 +22,11 @@ // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wconversion" -#pragma clang diagnostic ignored "-Wextra" #include "DisplayHardware/HWComposer.h" // TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion -Wextra" +#pragma clang diagnostic pop // ignored "-Wconversion" namespace android { namespace mock { @@ -39,74 +38,67 @@ public: HWComposer(); ~HWComposer() override; - MOCK_METHOD1(setCallback, void(HWC2::ComposerCallback*)); + MOCK_METHOD2(setConfiguration, void(HWC2::ComposerCallback*, int32_t)); MOCK_CONST_METHOD3(getDisplayIdentificationData, bool(hal::HWDisplayId, uint8_t*, DisplayIdentificationData*)); MOCK_CONST_METHOD1(hasCapability, bool(hal::Capability)); - MOCK_CONST_METHOD2(hasDisplayCapability, bool(HalDisplayId, hal::DisplayCapability)); + MOCK_CONST_METHOD2(hasDisplayCapability, bool(DisplayId, hal::DisplayCapability)); - MOCK_CONST_METHOD0(getMaxVirtualDisplayCount, size_t()); - MOCK_CONST_METHOD0(getMaxVirtualDisplayDimension, size_t()); - MOCK_METHOD4(allocateVirtualDisplay, - bool(HalVirtualDisplayId, ui::Size, ui::PixelFormat*, - std::optional<PhysicalDisplayId>)); - MOCK_METHOD2(allocatePhysicalDisplay, void(hal::HWDisplayId, PhysicalDisplayId)); - MOCK_METHOD1(createLayer, std::shared_ptr<HWC2::Layer>(HalDisplayId)); - MOCK_METHOD5(getDeviceCompositionChanges, - status_t(HalDisplayId, bool, std::chrono::steady_clock::time_point, - const std::shared_ptr<FenceTime>&, + MOCK_METHOD3(allocateVirtualDisplay, + std::optional<DisplayId>(uint32_t, uint32_t, ui::PixelFormat*)); + MOCK_METHOD2(allocatePhysicalDisplay, void(hal::HWDisplayId, DisplayId)); + MOCK_METHOD1(createLayer, HWC2::Layer*(DisplayId)); + MOCK_METHOD2(destroyLayer, void(DisplayId, HWC2::Layer*)); + MOCK_METHOD3(getDeviceCompositionChanges, + status_t(DisplayId, bool, std::optional<android::HWComposer::DeviceRequestedChanges>*)); MOCK_METHOD5(setClientTarget, - status_t(HalDisplayId, uint32_t, const sp<Fence>&, const sp<GraphicBuffer>&, + status_t(DisplayId, uint32_t, const sp<Fence>&, const sp<GraphicBuffer>&, ui::Dataspace)); - MOCK_METHOD3(presentAndGetReleaseFences, - status_t(HalDisplayId, std::chrono::steady_clock::time_point, - const std::shared_ptr<FenceTime>&)); - MOCK_METHOD2(setPowerMode, status_t(PhysicalDisplayId, hal::PowerMode)); - MOCK_METHOD2(setActiveConfig, status_t(HalDisplayId, size_t)); - MOCK_METHOD2(setColorTransform, status_t(HalDisplayId, const mat4&)); - MOCK_METHOD1(disconnectDisplay, void(HalDisplayId)); + MOCK_METHOD1(presentAndGetReleaseFences, status_t(DisplayId)); + MOCK_METHOD2(setPowerMode, status_t(DisplayId, hal::PowerMode)); + MOCK_METHOD2(setActiveConfig, status_t(DisplayId, size_t)); + MOCK_METHOD2(setColorTransform, status_t(DisplayId, const mat4&)); + MOCK_METHOD1(disconnectDisplay, void(DisplayId)); MOCK_CONST_METHOD1(hasDeviceComposition, bool(const std::optional<DisplayId>&)); - MOCK_CONST_METHOD1(getPresentFence, sp<Fence>(HalDisplayId)); - MOCK_CONST_METHOD2(getLayerReleaseFence, sp<Fence>(HalDisplayId, HWC2::Layer*)); - MOCK_METHOD3(setOutputBuffer, - status_t(HalVirtualDisplayId, const sp<Fence>&, const sp<GraphicBuffer>&)); - MOCK_METHOD1(clearReleaseFences, void(HalDisplayId)); - MOCK_METHOD2(getHdrCapabilities, status_t(HalDisplayId, HdrCapabilities*)); - MOCK_CONST_METHOD1(getSupportedPerFrameMetadata, int32_t(HalDisplayId)); - MOCK_CONST_METHOD2(getRenderIntents, - std::vector<ui::RenderIntent>(HalDisplayId, ui::ColorMode)); - MOCK_METHOD2(getDataspaceSaturationMatrix, mat4(HalDisplayId, ui::Dataspace)); + MOCK_CONST_METHOD1(getPresentFence, sp<Fence>(DisplayId)); + MOCK_CONST_METHOD2(getLayerReleaseFence, sp<Fence>(DisplayId, HWC2::Layer*)); + MOCK_METHOD3(setOutputBuffer, status_t(DisplayId, const sp<Fence>&, const sp<GraphicBuffer>&)); + MOCK_METHOD1(clearReleaseFences, void(DisplayId)); + MOCK_METHOD2(getHdrCapabilities, status_t(DisplayId, HdrCapabilities*)); + MOCK_CONST_METHOD1(getSupportedPerFrameMetadata, int32_t(DisplayId)); + MOCK_CONST_METHOD2(getRenderIntents, std::vector<ui::RenderIntent>(DisplayId, ui::ColorMode)); + MOCK_METHOD2(getDataspaceSaturationMatrix, mat4(DisplayId, ui::Dataspace)); MOCK_METHOD4(getDisplayedContentSamplingAttributes, - status_t(HalDisplayId, ui::PixelFormat*, ui::Dataspace*, uint8_t*)); - MOCK_METHOD4(setDisplayContentSamplingEnabled, status_t(HalDisplayId, bool, uint8_t, uint64_t)); + status_t(DisplayId, ui::PixelFormat*, ui::Dataspace*, uint8_t*)); + MOCK_METHOD4(setDisplayContentSamplingEnabled, status_t(DisplayId, bool, uint8_t, uint64_t)); MOCK_METHOD4(getDisplayedContentSample, - status_t(HalDisplayId, uint64_t, uint64_t, DisplayedFrameStats*)); - MOCK_METHOD2(setDisplayBrightness, std::future<status_t>(PhysicalDisplayId, float)); - MOCK_METHOD2(getDisplayBrightnessSupport, status_t(PhysicalDisplayId, bool*)); + status_t(DisplayId, uint64_t, uint64_t, DisplayedFrameStats*)); + MOCK_METHOD2(setDisplayBrightness, std::future<status_t>(DisplayId, float)); + MOCK_METHOD2(getDisplayBrightnessSupport, status_t(DisplayId, bool*)); MOCK_METHOD2(onHotplug, std::optional<DisplayIdentificationInfo>(hal::HWDisplayId, hal::Connection)); - MOCK_CONST_METHOD0(updatesDeviceProductInfoOnHotplugReconnect, bool()); MOCK_METHOD2(onVsync, bool(hal::HWDisplayId, int64_t)); - MOCK_METHOD2(setVsyncEnabled, void(PhysicalDisplayId, hal::Vsync)); - MOCK_CONST_METHOD1(isConnected, bool(PhysicalDisplayId)); - MOCK_CONST_METHOD1(getModes, std::vector<HWComposer::HWCDisplayMode>(PhysicalDisplayId)); - MOCK_CONST_METHOD1(getActiveMode, std::optional<hal::HWConfigId>(PhysicalDisplayId)); - MOCK_CONST_METHOD1(getColorModes, std::vector<ui::ColorMode>(PhysicalDisplayId)); - MOCK_METHOD3(setActiveColorMode, status_t(PhysicalDisplayId, ui::ColorMode, ui::RenderIntent)); + MOCK_METHOD2(setVsyncEnabled, void(DisplayId, hal::Vsync)); + MOCK_CONST_METHOD1(getRefreshTimestamp, nsecs_t(DisplayId)); + MOCK_CONST_METHOD1(isConnected, bool(DisplayId)); + MOCK_CONST_METHOD1(getConfigs, + std::vector<std::shared_ptr<const HWC2::Display::Config>>(DisplayId)); + MOCK_CONST_METHOD1(getActiveConfig, std::shared_ptr<const HWC2::Display::Config>(DisplayId)); + MOCK_CONST_METHOD1(getActiveConfigIndex, int(DisplayId)); + MOCK_CONST_METHOD1(getColorModes, std::vector<ui::ColorMode>(DisplayId)); + MOCK_METHOD3(setActiveColorMode, status_t(DisplayId, ui::ColorMode, ui::RenderIntent)); MOCK_CONST_METHOD0(isUsingVrComposer, bool()); - MOCK_CONST_METHOD1(getDisplayConnectionType, ui::DisplayConnectionType(PhysicalDisplayId)); - MOCK_CONST_METHOD1(isVsyncPeriodSwitchSupported, bool(PhysicalDisplayId)); - MOCK_CONST_METHOD2(getDisplayVsyncPeriod, status_t(PhysicalDisplayId, nsecs_t*)); - MOCK_METHOD4(setActiveModeWithConstraints, - status_t(PhysicalDisplayId, hal::HWConfigId, - const hal::VsyncPeriodChangeConstraints&, + MOCK_CONST_METHOD1(getDisplayConnectionType, DisplayConnectionType(DisplayId)); + MOCK_CONST_METHOD1(isVsyncPeriodSwitchSupported, bool(DisplayId)); + MOCK_CONST_METHOD1(getDisplayVsyncPeriod, nsecs_t(DisplayId)); + MOCK_METHOD4(setActiveConfigWithConstraints, + status_t(DisplayId, size_t, const hal::VsyncPeriodChangeConstraints&, hal::VsyncPeriodChangeTimeline*)); - MOCK_METHOD2(setAutoLowLatencyMode, status_t(PhysicalDisplayId, bool)); - MOCK_METHOD2(getSupportedContentTypes, - status_t(PhysicalDisplayId, std::vector<hal::ContentType>*)); - MOCK_METHOD2(setContentType, status_t(PhysicalDisplayId, hal::ContentType)); + MOCK_METHOD2(setAutoLowLatencyMode, status_t(DisplayId, bool)); + MOCK_METHOD2(getSupportedContentTypes, status_t(DisplayId, std::vector<hal::ContentType>*)); + MOCK_METHOD2(setContentType, status_t(DisplayId, hal::ContentType)); MOCK_CONST_METHOD0(getSupportedLayerGenericMetadata, const std::unordered_map<std::string, bool>&()); @@ -115,8 +107,8 @@ public: MOCK_CONST_METHOD1(getHwcDisplayId, std::optional<hal::HWDisplayId>(int32_t)); MOCK_CONST_METHOD0(getInternalHwcDisplayId, std::optional<hal::HWDisplayId>()); MOCK_CONST_METHOD0(getExternalHwcDisplayId, std::optional<hal::HWDisplayId>()); - MOCK_CONST_METHOD1(toPhysicalDisplayId, std::optional<PhysicalDisplayId>(hal::HWDisplayId)); - MOCK_CONST_METHOD1(fromPhysicalDisplayId, std::optional<hal::HWDisplayId>(PhysicalDisplayId)); + MOCK_CONST_METHOD1(toPhysicalDisplayId, std::optional<DisplayId>(hal::HWDisplayId)); + MOCK_CONST_METHOD1(fromPhysicalDisplayId, std::optional<hal::HWDisplayId>(DisplayId)); }; } // namespace mock |