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