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 19 #include <compositionengine/DisplayColorProfile.h> 20 #include <compositionengine/Layer.h> 21 #include <compositionengine/LayerFE.h> 22 #include <compositionengine/Output.h> 23 #include <compositionengine/OutputLayer.h> 24 #include <compositionengine/RenderSurface.h> 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)); 40 MOCK_METHOD1(setBounds, void(const ui::Size&)); 41 MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool)); 42 43 MOCK_METHOD1(setColorTransform, void(const mat4&)); 44 MOCK_METHOD3(setColorMode, void(ui::ColorMode, ui::Dataspace, ui::RenderIntent)); 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 50 MOCK_CONST_METHOD0(getDisplayColorProfile, DisplayColorProfile*()); 51 MOCK_METHOD1(setDisplayColorProfile, void(std::unique_ptr<DisplayColorProfile>)); 52 53 MOCK_CONST_METHOD0(getRenderSurface, RenderSurface*()); 54 MOCK_METHOD1(setRenderSurface, void(std::unique_ptr<RenderSurface>)); 55 56 MOCK_CONST_METHOD0(getState, const OutputCompositionState&()); 57 MOCK_METHOD0(editState, OutputCompositionState&()); 58 59 MOCK_CONST_METHOD1(getDirtyRegion, Region(bool)); 60 MOCK_CONST_METHOD2(belongsInOutput, bool(uint32_t, bool)); 61 62 MOCK_CONST_METHOD1(getOutputLayerForLayer, 63 compositionengine::OutputLayer*(compositionengine::Layer*)); 64 MOCK_METHOD3(getOrCreateOutputLayer, 65 std::unique_ptr<compositionengine::OutputLayer>( 66 std::optional<DisplayId>, std::shared_ptr<compositionengine::Layer>, 67 sp<compositionengine::LayerFE>)); 68 MOCK_METHOD1(setOutputLayersOrderedByZ, void(OutputLayers&&)); 69 MOCK_CONST_METHOD0(getOutputLayersOrderedByZ, OutputLayers&()); 70 }; 71 72 } // namespace android::compositionengine::mock 73