blob: b8679d8021490992e7dc39c74a8cf7fe7690f9f7 [file] [log] [blame]
Lloyd Pique32cbe282018-10-19 13:09:22 -07001/*
2 * Copyright 2019 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
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070019#include <compositionengine/DisplayColorProfile.h>
Lloyd Piquecc01a452018-12-04 17:24:00 -080020#include <compositionengine/Layer.h>
21#include <compositionengine/LayerFE.h>
Lloyd Pique32cbe282018-10-19 13:09:22 -070022#include <compositionengine/Output.h>
Lloyd Piquecc01a452018-12-04 17:24:00 -080023#include <compositionengine/OutputLayer.h>
Lloyd Pique31cb2942018-10-19 17:23:03 -070024#include <compositionengine/RenderSurface.h>
Lloyd Pique32cbe282018-10-19 13:09:22 -070025#include <compositionengine/impl/OutputCompositionState.h>
26#include <gmock/gmock.h>
27
28namespace android::compositionengine::mock {
29
30class Output : public virtual compositionengine::Output {
31public:
32 Output();
33 virtual ~Output();
34
35 MOCK_CONST_METHOD0(isValid, bool());
36
37 MOCK_METHOD1(setCompositionEnabled, void(bool));
38 MOCK_METHOD6(setProjection,
39 void(const ui::Transform&, int32_t, const Rect&, const Rect&, const Rect&, bool));
Lloyd Pique31cb2942018-10-19 17:23:03 -070040 MOCK_METHOD1(setBounds, void(const ui::Size&));
Lloyd Piqueef36b002019-01-23 17:52:04 -080041 MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool));
Lloyd Pique32cbe282018-10-19 13:09:22 -070042
43 MOCK_METHOD1(setColorTransform, void(const mat4&));
Lloyd Piquef5275482019-01-29 18:42:42 -080044 MOCK_METHOD4(setColorMode, void(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace));
Lloyd Pique32cbe282018-10-19 13:09:22 -070045
46 MOCK_CONST_METHOD1(dump, void(std::string&));
47 MOCK_CONST_METHOD0(getName, const std::string&());
48 MOCK_METHOD1(setName, void(const std::string&));
49
Lloyd Piquef5275482019-01-29 18:42:42 -080050 MOCK_CONST_METHOD0(getDisplayColorProfile, compositionengine::DisplayColorProfile*());
51 MOCK_METHOD1(setDisplayColorProfile,
52 void(std::unique_ptr<compositionengine::DisplayColorProfile>));
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070053
Lloyd Piquef5275482019-01-29 18:42:42 -080054 MOCK_CONST_METHOD0(getRenderSurface, compositionengine::RenderSurface*());
55 MOCK_METHOD1(setRenderSurface, void(std::unique_ptr<compositionengine::RenderSurface>));
Lloyd Pique31cb2942018-10-19 17:23:03 -070056
Lloyd Pique32cbe282018-10-19 13:09:22 -070057 MOCK_CONST_METHOD0(getState, const OutputCompositionState&());
58 MOCK_METHOD0(editState, OutputCompositionState&());
59
Alec Mourie7d1d4a2019-02-05 01:13:46 +000060 MOCK_CONST_METHOD1(getDirtyRegion, Region(bool));
Lloyd Piqueef36b002019-01-23 17:52:04 -080061 MOCK_CONST_METHOD2(belongsInOutput, bool(uint32_t, bool));
Lloyd Piquecc01a452018-12-04 17:24:00 -080062
63 MOCK_CONST_METHOD1(getOutputLayerForLayer,
64 compositionengine::OutputLayer*(compositionengine::Layer*));
Lloyd Pique07e33212018-12-18 16:33:37 -080065 MOCK_METHOD3(getOrCreateOutputLayer,
Lloyd Piquecc01a452018-12-04 17:24:00 -080066 std::unique_ptr<compositionengine::OutputLayer>(
Lloyd Pique07e33212018-12-18 16:33:37 -080067 std::optional<DisplayId>, std::shared_ptr<compositionengine::Layer>,
Lloyd Piquecc01a452018-12-04 17:24:00 -080068 sp<compositionengine::LayerFE>));
Lloyd Piquec7ef21b2019-01-29 18:43:00 -080069
Lloyd Piquecc01a452018-12-04 17:24:00 -080070 MOCK_METHOD1(setOutputLayersOrderedByZ, void(OutputLayers&&));
71 MOCK_CONST_METHOD0(getOutputLayersOrderedByZ, OutputLayers&());
Lloyd Piquec7ef21b2019-01-29 18:43:00 -080072
73 MOCK_METHOD1(setReleasedLayers, void(ReleasedLayers&&));
74 MOCK_METHOD0(takeReleasedLayers, ReleasedLayers());
Lloyd Pique66d68602019-02-13 14:23:31 -080075
76 MOCK_METHOD0(prepareFrame, void());
77 MOCK_METHOD0(chooseCompositionStrategy, void());
Lloyd Pique32cbe282018-10-19 13:09:22 -070078};
79
80} // namespace android::compositionengine::mock