• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <gmock/gmock.h>
20 
21 #include "DisplayHardware/PowerAdvisor.h"
22 
23 namespace android::Hwc2::mock {
24 
25 class PowerAdvisor : public android::Hwc2::PowerAdvisor {
26 public:
27     PowerAdvisor();
28     ~PowerAdvisor() override;
29 
30     MOCK_METHOD(void, init, (), (override));
31     MOCK_METHOD(void, onBootFinished, (), (override));
32     MOCK_METHOD(void, setExpensiveRenderingExpected, (DisplayId displayId, bool expected),
33                 (override));
34     MOCK_METHOD(bool, isUsingExpensiveRendering, (), (override));
35     MOCK_METHOD(void, notifyCpuLoadUp, (), (override));
36     MOCK_METHOD(void, notifyDisplayUpdateImminentAndCpuReset, (), (override));
37     MOCK_METHOD(bool, usePowerHintSession, (), (override));
38     MOCK_METHOD(bool, supportsPowerHintSession, (), (override));
39     MOCK_METHOD(bool, ensurePowerHintSessionRunning, (), (override));
40     MOCK_METHOD(void, updateTargetWorkDuration, (Duration targetDuration), (override));
41     MOCK_METHOD(void, reportActualWorkDuration, (), (override));
42     MOCK_METHOD(void, enablePowerHintSession, (bool enabled), (override));
43     MOCK_METHOD(bool, startPowerHintSession, (const std::vector<int32_t>& threadIds), (override));
44     MOCK_METHOD(void, setGpuFenceTime,
45                 (DisplayId displayId, std::unique_ptr<FenceTime>&& fenceTime), (override));
46     MOCK_METHOD(void, setHwcValidateTiming,
47                 (DisplayId displayId, TimePoint validateStartTime, TimePoint validateEndTime),
48                 (override));
49     MOCK_METHOD(void, setHwcPresentTiming,
50                 (DisplayId displayId, TimePoint presentStartTime, TimePoint presentEndTime),
51                 (override));
52     MOCK_METHOD(void, setSkippedValidate, (DisplayId displayId, bool skipped), (override));
53     MOCK_METHOD(void, setRequiresClientComposition,
54                 (DisplayId displayId, bool requiresClientComposition), (override));
55     MOCK_METHOD(void, setExpectedPresentTime, (TimePoint expectedPresentTime), (override));
56     MOCK_METHOD(void, setSfPresentTiming, (TimePoint presentFenceTime, TimePoint presentEndTime),
57                 (override));
58     MOCK_METHOD(void, setHwcPresentDelayedTime,
59                 (DisplayId displayId, TimePoint earliestFrameStartTime));
60     MOCK_METHOD(void, setFrameDelay, (Duration frameDelayDuration), (override));
61     MOCK_METHOD(void, setCommitStart, (TimePoint commitStartTime), (override));
62     MOCK_METHOD(void, setCompositeEnd, (TimePoint compositeEndTime), (override));
63     MOCK_METHOD(void, setDisplays, (std::vector<DisplayId> & displayIds), (override));
64     MOCK_METHOD(void, setTotalFrameTargetWorkDuration, (Duration targetDuration), (override));
65 };
66 
67 } // namespace android::Hwc2::mock
68