MockHWC2.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 <gmock/gmock.h>
  18. #include <ui/Fence.h>
  19. #include <ui/FloatRect.h>
  20. #include <ui/GraphicBuffer.h>
  21. #include <ui/GraphicTypes.h>
  22. #include <ui/Rect.h>
  23. #include <ui/Region.h>
  24. #include <ui/Transform.h>
  25. #include "DisplayHardware/HWC2.h"
  26. namespace HWC2 {
  27. namespace mock {
  28. class Layer : public HWC2::Layer {
  29. public:
  30. Layer();
  31. ~Layer() override;
  32. MOCK_CONST_METHOD0(getId, hwc2_layer_t());
  33. MOCK_METHOD2(setCursorPosition, Error(int32_t, int32_t));
  34. MOCK_METHOD3(setBuffer,
  35. Error(uint32_t, const android::sp<android::GraphicBuffer>&,
  36. const android::sp<android::Fence>&));
  37. MOCK_METHOD1(setSurfaceDamage, Error(const android::Region&));
  38. MOCK_METHOD1(setBlendMode, Error(BlendMode));
  39. MOCK_METHOD1(setColor, Error(hwc_color_t));
  40. MOCK_METHOD1(setCompositionType, Error(Composition));
  41. MOCK_METHOD1(setDataspace, Error(android::ui::Dataspace));
  42. MOCK_METHOD2(setPerFrameMetadata, Error(const int32_t, const android::HdrMetadata&));
  43. MOCK_METHOD1(setDisplayFrame, Error(const android::Rect&));
  44. MOCK_METHOD1(setPlaneAlpha, Error(float));
  45. MOCK_METHOD1(setSidebandStream, Error(const native_handle_t*));
  46. MOCK_METHOD1(setSourceCrop, Error(const android::FloatRect&));
  47. MOCK_METHOD1(setTransform, Error(Transform));
  48. MOCK_METHOD1(setVisibleRegion, Error(const android::Region&));
  49. MOCK_METHOD1(setZOrder, Error(uint32_t));
  50. MOCK_METHOD2(setInfo, Error(uint32_t, uint32_t));
  51. MOCK_METHOD1(setColorTransform, Error(const android::mat4&));
  52. };
  53. } // namespace mock
  54. } // namespace HWC2