Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 1 | /* |
| 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 Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 19 | #include <compositionengine/DisplayColorProfile.h> |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 20 | #include <compositionengine/Layer.h> |
| 21 | #include <compositionengine/LayerFE.h> |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 22 | #include <compositionengine/Output.h> |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 23 | #include <compositionengine/OutputLayer.h> |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 24 | #include <compositionengine/RenderSurface.h> |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 25 | #include <compositionengine/impl/OutputCompositionState.h> |
| 26 | #include <gmock/gmock.h> |
| 27 | |
| 28 | namespace android::compositionengine::mock { |
| 29 | |
| 30 | class Output : public virtual compositionengine::Output { |
| 31 | public: |
| 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 Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 40 | MOCK_METHOD1(setBounds, void(const ui::Size&)); |
Lloyd Pique | ef36b00 | 2019-01-23 17:52:04 -0800 | [diff] [blame] | 41 | MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool)); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 42 | |
| 43 | MOCK_METHOD1(setColorTransform, void(const mat4&)); |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 44 | MOCK_METHOD4(setColorMode, void(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace)); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 45 | |
| 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 Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 50 | MOCK_CONST_METHOD0(getDisplayColorProfile, compositionengine::DisplayColorProfile*()); |
| 51 | MOCK_METHOD1(setDisplayColorProfile, |
| 52 | void(std::unique_ptr<compositionengine::DisplayColorProfile>)); |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 53 | |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 54 | MOCK_CONST_METHOD0(getRenderSurface, compositionengine::RenderSurface*()); |
| 55 | MOCK_METHOD1(setRenderSurface, void(std::unique_ptr<compositionengine::RenderSurface>)); |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 56 | |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 57 | MOCK_CONST_METHOD0(getState, const OutputCompositionState&()); |
| 58 | MOCK_METHOD0(editState, OutputCompositionState&()); |
| 59 | |
Alec Mouri | e7d1d4a | 2019-02-05 01:13:46 +0000 | [diff] [blame] | 60 | MOCK_CONST_METHOD1(getDirtyRegion, Region(bool)); |
Lloyd Pique | ef36b00 | 2019-01-23 17:52:04 -0800 | [diff] [blame] | 61 | MOCK_CONST_METHOD2(belongsInOutput, bool(uint32_t, bool)); |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 62 | |
| 63 | MOCK_CONST_METHOD1(getOutputLayerForLayer, |
| 64 | compositionengine::OutputLayer*(compositionengine::Layer*)); |
Lloyd Pique | 07e3321 | 2018-12-18 16:33:37 -0800 | [diff] [blame] | 65 | MOCK_METHOD3(getOrCreateOutputLayer, |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 66 | std::unique_ptr<compositionengine::OutputLayer>( |
Lloyd Pique | 07e3321 | 2018-12-18 16:33:37 -0800 | [diff] [blame] | 67 | std::optional<DisplayId>, std::shared_ptr<compositionengine::Layer>, |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 68 | sp<compositionengine::LayerFE>)); |
Lloyd Pique | c7ef21b | 2019-01-29 18:43:00 -0800 | [diff] [blame] | 69 | |
Lloyd Pique | cc01a45 | 2018-12-04 17:24:00 -0800 | [diff] [blame] | 70 | MOCK_METHOD1(setOutputLayersOrderedByZ, void(OutputLayers&&)); |
| 71 | MOCK_CONST_METHOD0(getOutputLayersOrderedByZ, OutputLayers&()); |
Lloyd Pique | c7ef21b | 2019-01-29 18:43:00 -0800 | [diff] [blame] | 72 | |
| 73 | MOCK_METHOD1(setReleasedLayers, void(ReleasedLayers&&)); |
| 74 | MOCK_METHOD0(takeReleasedLayers, ReleasedLayers()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame^] | 75 | |
| 76 | MOCK_METHOD0(prepareFrame, void()); |
| 77 | MOCK_METHOD0(chooseCompositionStrategy, void()); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | } // namespace android::compositionengine::mock |