RenderSurface.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/RenderSurface.h>
  18. #include <gmock/gmock.h>
  19. #include <ui/GraphicBuffer.h>
  20. namespace android::compositionengine::mock {
  21. class RenderSurface : public compositionengine::RenderSurface {
  22. public:
  23. RenderSurface();
  24. ~RenderSurface() override;
  25. MOCK_CONST_METHOD0(isValid, bool());
  26. MOCK_METHOD0(initialize, void());
  27. MOCK_CONST_METHOD0(getSize, const ui::Size&());
  28. MOCK_CONST_METHOD0(isProtected, bool());
  29. MOCK_CONST_METHOD0(getClientTargetAcquireFence, const sp<Fence>&());
  30. MOCK_METHOD1(setDisplaySize, void(const ui::Size&));
  31. MOCK_METHOD1(setProtected, void(bool));
  32. MOCK_METHOD1(setBufferDataspace, void(ui::Dataspace));
  33. MOCK_METHOD1(beginFrame, status_t(bool mustRecompose));
  34. MOCK_METHOD0(prepareFrame, status_t());
  35. MOCK_METHOD1(dequeueBuffer, sp<GraphicBuffer>(base::unique_fd*));
  36. MOCK_METHOD1(queueBuffer, void(base::unique_fd&&));
  37. MOCK_METHOD0(onPresentDisplayCompleted, void());
  38. MOCK_METHOD0(setViewportAndProjection, void());
  39. MOCK_METHOD0(flip, void());
  40. MOCK_CONST_METHOD1(dump, void(std::string& result));
  41. MOCK_CONST_METHOD0(getPageFlipCount, std::uint32_t());
  42. };
  43. } // namespace android::compositionengine::mock