Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 1 | /* |
Lloyd Pique | 3823e7b | 2018-10-18 16:58:10 -0700 | [diff] [blame] | 2 | * Copyright 2018 The Android Open Source Project |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 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 <gmock/gmock.h> |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 20 | #include <renderengine/DisplaySettings.h> |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 21 | #include <renderengine/LayerSettings.h> |
Peiyong Lin | cbc184f | 2018-08-22 13:24:10 -0700 | [diff] [blame] | 22 | #include <renderengine/Mesh.h> |
| 23 | #include <renderengine/RenderEngine.h> |
Peiyong Lin | cbc184f | 2018-08-22 13:24:10 -0700 | [diff] [blame] | 24 | #include <renderengine/Texture.h> |
Alec Mouri | 4dde178 | 2019-09-30 17:27:13 -0700 | [diff] [blame] | 25 | #include <ui/Fence.h> |
Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 26 | #include <ui/GraphicBuffer.h> |
Lloyd Pique | 3823e7b | 2018-10-18 16:58:10 -0700 | [diff] [blame] | 27 | #include <ui/Region.h> |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 28 | |
| 29 | namespace android { |
Peiyong Lin | 833074a | 2018-08-28 11:53:54 -0700 | [diff] [blame] | 30 | namespace renderengine { |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 31 | namespace mock { |
| 32 | |
Peiyong Lin | 833074a | 2018-08-28 11:53:54 -0700 | [diff] [blame] | 33 | class RenderEngine : public renderengine::RenderEngine { |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 34 | public: |
| 35 | RenderEngine(); |
| 36 | ~RenderEngine() override; |
| 37 | |
Alec Mouri | 820c740 | 2019-01-23 13:02:39 -0800 | [diff] [blame] | 38 | MOCK_METHOD0(getFramebufferForDrawing, Framebuffer*()); |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 39 | MOCK_CONST_METHOD0(primeCache, void()); |
Yiwei Zhang | 5434a78 | 2018-12-05 18:06:32 -0800 | [diff] [blame] | 40 | MOCK_METHOD1(dump, void(std::string&)); |
Lloyd Pique | 63f9dbf | 2018-06-21 13:13:07 -0700 | [diff] [blame] | 41 | MOCK_CONST_METHOD0(useNativeFenceSync, bool()); |
| 42 | MOCK_CONST_METHOD0(useWaitSync, bool()); |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 43 | MOCK_CONST_METHOD0(isCurrent, bool()); |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 44 | MOCK_METHOD2(genTextures, void(size_t, uint32_t*)); |
| 45 | MOCK_METHOD2(deleteTextures, void(size_t, uint32_t const*)); |
Peiyong Lin | 833074a | 2018-08-28 11:53:54 -0700 | [diff] [blame] | 46 | MOCK_METHOD2(bindExternalTextureImage, void(uint32_t, const renderengine::Image&)); |
Alec Mouri | 16a9940 | 2019-07-29 16:37:30 -0700 | [diff] [blame] | 47 | MOCK_METHOD1(cacheExternalTextureBuffer, void(const sp<GraphicBuffer>&)); |
Alec Mouri | d7b3a8b | 2019-03-21 11:44:18 -0700 | [diff] [blame] | 48 | MOCK_METHOD3(bindExternalTextureBuffer, |
| 49 | status_t(uint32_t, const sp<GraphicBuffer>&, const sp<Fence>&)); |
Alec Mouri | b5c4f35 | 2019-02-19 19:46:38 -0800 | [diff] [blame] | 50 | MOCK_METHOD1(unbindExternalTextureBuffer, void(uint64_t)); |
Lloyd Pique | 3823e7b | 2018-10-18 16:58:10 -0700 | [diff] [blame] | 51 | MOCK_METHOD1(bindFrameBuffer, status_t(renderengine::Framebuffer*)); |
| 52 | MOCK_METHOD1(unbindFrameBuffer, void(renderengine::Framebuffer*)); |
| 53 | MOCK_METHOD1(drawMesh, void(const renderengine::Mesh&)); |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 54 | MOCK_CONST_METHOD0(getMaxTextureSize, size_t()); |
| 55 | MOCK_CONST_METHOD0(getMaxViewportDims, size_t()); |
Peiyong Lin | fb530cf | 2018-12-15 05:07:38 +0000 | [diff] [blame] | 56 | MOCK_CONST_METHOD0(isProtected, bool()); |
| 57 | MOCK_CONST_METHOD0(supportsProtectedContent, bool()); |
| 58 | MOCK_METHOD1(useProtectedContext, bool(bool)); |
Ramakant Singh | 632e598 | 2020-08-14 15:58:09 +0530 | [diff] [blame] | 59 | MOCK_METHOD2(setViewportAndProjection, |
| 60 | void(Rect, Rect)); |
Alec Mouri | 1846e8a | 2020-08-13 10:14:29 -0700 | [diff] [blame] | 61 | MOCK_METHOD1(cleanupPostRender, bool(CleanupMode mode)); |
Alec Mouri | fe0d72b | 2019-03-21 14:05:56 -0700 | [diff] [blame] | 62 | MOCK_METHOD6(drawLayers, |
Vishnu Nair | 9b079a2 | 2020-01-21 14:36:08 -0800 | [diff] [blame] | 63 | status_t(const DisplaySettings&, const std::vector<const LayerSettings*>&, |
Alec Mouri | fe0d72b | 2019-03-21 14:05:56 -0700 | [diff] [blame] | 64 | ANativeWindowBuffer*, const bool, base::unique_fd&&, base::unique_fd*)); |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 65 | }; |
| 66 | |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 67 | } // namespace mock |
Peiyong Lin | 833074a | 2018-08-28 11:53:54 -0700 | [diff] [blame] | 68 | } // namespace renderengine |
Lloyd Pique | 2ee3957 | 2017-12-20 16:48:10 -0800 | [diff] [blame] | 69 | } // namespace android |