blob: 0a80170775aaa4433cc415815a4913f98c015da4 [file] [log] [blame]
Lloyd Pique2ee39572017-12-20 16:48:10 -08001/*
Lloyd Pique3823e7b2018-10-18 16:58:10 -07002 * Copyright 2018 The Android Open Source Project
Lloyd Pique2ee39572017-12-20 16:48:10 -08003 *
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 <gmock/gmock.h>
Alec Mouri6e57f682018-09-29 20:45:08 -070020#include <renderengine/DisplaySettings.h>
Alec Mouri6e57f682018-09-29 20:45:08 -070021#include <renderengine/LayerSettings.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070022#include <renderengine/Mesh.h>
23#include <renderengine/RenderEngine.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070024#include <renderengine/Texture.h>
Alec Mouri4dde1782019-09-30 17:27:13 -070025#include <ui/Fence.h>
Alec Mouri6e57f682018-09-29 20:45:08 -070026#include <ui/GraphicBuffer.h>
Lloyd Pique3823e7b2018-10-18 16:58:10 -070027#include <ui/Region.h>
Lloyd Pique2ee39572017-12-20 16:48:10 -080028
29namespace android {
Peiyong Lin833074a2018-08-28 11:53:54 -070030namespace renderengine {
Lloyd Pique2ee39572017-12-20 16:48:10 -080031namespace mock {
32
Peiyong Lin833074a2018-08-28 11:53:54 -070033class RenderEngine : public renderengine::RenderEngine {
Lloyd Pique2ee39572017-12-20 16:48:10 -080034public:
35 RenderEngine();
36 ~RenderEngine() override;
37
Alec Mouri820c7402019-01-23 13:02:39 -080038 MOCK_METHOD0(getFramebufferForDrawing, Framebuffer*());
Lloyd Pique2ee39572017-12-20 16:48:10 -080039 MOCK_CONST_METHOD0(primeCache, void());
Yiwei Zhang5434a782018-12-05 18:06:32 -080040 MOCK_METHOD1(dump, void(std::string&));
Lloyd Pique63f9dbf2018-06-21 13:13:07 -070041 MOCK_CONST_METHOD0(useNativeFenceSync, bool());
42 MOCK_CONST_METHOD0(useWaitSync, bool());
Lloyd Pique2ee39572017-12-20 16:48:10 -080043 MOCK_CONST_METHOD0(isCurrent, bool());
Lloyd Pique2ee39572017-12-20 16:48:10 -080044 MOCK_METHOD2(genTextures, void(size_t, uint32_t*));
45 MOCK_METHOD2(deleteTextures, void(size_t, uint32_t const*));
Peiyong Lin833074a2018-08-28 11:53:54 -070046 MOCK_METHOD2(bindExternalTextureImage, void(uint32_t, const renderengine::Image&));
Alec Mouri16a99402019-07-29 16:37:30 -070047 MOCK_METHOD1(cacheExternalTextureBuffer, void(const sp<GraphicBuffer>&));
Alec Mourid7b3a8b2019-03-21 11:44:18 -070048 MOCK_METHOD3(bindExternalTextureBuffer,
49 status_t(uint32_t, const sp<GraphicBuffer>&, const sp<Fence>&));
Alec Mourib5c4f352019-02-19 19:46:38 -080050 MOCK_METHOD1(unbindExternalTextureBuffer, void(uint64_t));
Lloyd Pique3823e7b2018-10-18 16:58:10 -070051 MOCK_METHOD1(bindFrameBuffer, status_t(renderengine::Framebuffer*));
52 MOCK_METHOD1(unbindFrameBuffer, void(renderengine::Framebuffer*));
53 MOCK_METHOD1(drawMesh, void(const renderengine::Mesh&));
Lloyd Pique2ee39572017-12-20 16:48:10 -080054 MOCK_CONST_METHOD0(getMaxTextureSize, size_t());
55 MOCK_CONST_METHOD0(getMaxViewportDims, size_t());
Peiyong Linfb530cf2018-12-15 05:07:38 +000056 MOCK_CONST_METHOD0(isProtected, bool());
57 MOCK_CONST_METHOD0(supportsProtectedContent, bool());
58 MOCK_METHOD1(useProtectedContext, bool(bool));
Ramakant Singh632e5982020-08-14 15:58:09 +053059 MOCK_METHOD2(setViewportAndProjection,
60 void(Rect, Rect));
Alec Mouri1846e8a2020-08-13 10:14:29 -070061 MOCK_METHOD1(cleanupPostRender, bool(CleanupMode mode));
Alec Mourife0d72b2019-03-21 14:05:56 -070062 MOCK_METHOD6(drawLayers,
Vishnu Nair9b079a22020-01-21 14:36:08 -080063 status_t(const DisplaySettings&, const std::vector<const LayerSettings*>&,
Alec Mourife0d72b2019-03-21 14:05:56 -070064 ANativeWindowBuffer*, const bool, base::unique_fd&&, base::unique_fd*));
Lloyd Pique2ee39572017-12-20 16:48:10 -080065};
66
Lloyd Pique2ee39572017-12-20 16:48:10 -080067} // namespace mock
Peiyong Lin833074a2018-08-28 11:53:54 -070068} // namespace renderengine
Lloyd Pique2ee39572017-12-20 16:48:10 -080069} // namespace android