Output.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #pragma once
  17. #include <compositionengine/DisplayColorProfile.h>
  18. #include <compositionengine/Layer.h>
  19. #include <compositionengine/LayerFE.h>
  20. #include <compositionengine/Output.h>
  21. #include <compositionengine/OutputLayer.h>
  22. #include <compositionengine/RenderSurface.h>
  23. #include <compositionengine/impl/OutputCompositionState.h>
  24. #include <gmock/gmock.h>
  25. namespace android::compositionengine::mock {
  26. class Output : public virtual compositionengine::Output {
  27. public:
  28. Output();
  29. virtual ~Output();
  30. MOCK_CONST_METHOD0(isValid, bool());
  31. MOCK_METHOD1(setCompositionEnabled, void(bool));
  32. MOCK_METHOD6(setProjection,
  33. void(const ui::Transform&, int32_t, const Rect&, const Rect&, const Rect&, bool));
  34. MOCK_METHOD1(setBounds, void(const ui::Size&));
  35. MOCK_METHOD2(setLayerStackFilter, void(uint32_t, bool));
  36. MOCK_METHOD1(setColorTransform, void(const mat4&));
  37. MOCK_METHOD3(setColorMode, void(ui::ColorMode, ui::Dataspace, ui::RenderIntent));
  38. MOCK_CONST_METHOD1(dump, void(std::string&));
  39. MOCK_CONST_METHOD0(getName, const std::string&());
  40. MOCK_METHOD1(setName, void(const std::string&));
  41. MOCK_CONST_METHOD0(getDisplayColorProfile, DisplayColorProfile*());
  42. MOCK_METHOD1(setDisplayColorProfile, void(std::unique_ptr<DisplayColorProfile>));
  43. MOCK_CONST_METHOD0(getRenderSurface, RenderSurface*());
  44. MOCK_METHOD1(setRenderSurface, void(std::unique_ptr<RenderSurface>));
  45. MOCK_CONST_METHOD0(getState, const OutputCompositionState&());
  46. MOCK_METHOD0(editState, OutputCompositionState&());
  47. MOCK_CONST_METHOD1(getDirtyRegion, Region(bool));
  48. MOCK_CONST_METHOD2(belongsInOutput, bool(uint32_t, const String8&, const String8&, bool));
  49. MOCK_CONST_METHOD1(getOutputLayerForLayer,
  50. compositionengine::OutputLayer*(compositionengine::Layer*));
  51. MOCK_METHOD3(getOrCreateOutputLayer,
  52. std::unique_ptr<compositionengine::OutputLayer>(
  53. std::optional<DisplayId>, std::shared_ptr<compositionengine::Layer>,
  54. sp<compositionengine::LayerFE>));
  55. MOCK_METHOD1(setOutputLayersOrderedByZ, void(OutputLayers&&));
  56. MOCK_CONST_METHOD0(getOutputLayersOrderedByZ, OutputLayers&());
  57. };
  58. } // namespace android::compositionengine::mock