| John Reck | 67b1e2b | 2020-08-26 13:17:24 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright 2020 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 | #ifndef SF_SKIARENDERENGINE_H_ | 
|  | 18 | #define SF_SKIARENDERENGINE_H_ | 
|  | 19 |  | 
|  | 20 | #include <renderengine/RenderEngine.h> | 
|  | 21 | #include <sys/types.h> | 
|  | 22 |  | 
|  | 23 | namespace android { | 
|  | 24 |  | 
|  | 25 | namespace renderengine { | 
|  | 26 |  | 
|  | 27 | class Mesh; | 
|  | 28 | class Texture; | 
|  | 29 |  | 
|  | 30 | namespace skia { | 
|  | 31 |  | 
|  | 32 | class BlurFilter; | 
|  | 33 |  | 
|  | 34 | // TODO: Put common skia stuff here that can be shared between the GL & Vulkan backends | 
|  | 35 | // Currently mostly just handles all the no-op / missing APIs | 
| Alec Mouri | 081be4c | 2020-09-16 10:24:47 -0700 | [diff] [blame] | 36 | class SkiaRenderEngine : public RenderEngine { | 
| John Reck | 67b1e2b | 2020-08-26 13:17:24 -0700 | [diff] [blame] | 37 | public: | 
|  | 38 | static std::unique_ptr<SkiaRenderEngine> create(const RenderEngineCreationArgs& args); | 
| Alec Mouri | 0d99510 | 2021-02-24 16:53:38 -0800 | [diff] [blame] | 39 | SkiaRenderEngine(RenderEngineType type) : RenderEngine(type) {} | 
| John Reck | 67b1e2b | 2020-08-26 13:17:24 -0700 | [diff] [blame] | 40 | ~SkiaRenderEngine() override {} | 
|  | 41 |  | 
| Leon Scroggins III | b9216dc | 2021-03-08 17:19:01 -0500 | [diff] [blame] | 42 | virtual void primeCache() override{}; | 
| John Reck | 67b1e2b | 2020-08-26 13:17:24 -0700 | [diff] [blame] | 43 | virtual void genTextures(size_t /*count*/, uint32_t* /*names*/) override{}; | 
|  | 44 | virtual void deleteTextures(size_t /*count*/, uint32_t const* /*names*/) override{}; | 
| John Reck | 67b1e2b | 2020-08-26 13:17:24 -0700 | [diff] [blame] | 45 | virtual void cacheExternalTextureBuffer(const sp<GraphicBuffer>& /*buffer*/){}; | 
|  | 46 | virtual void unbindExternalTextureBuffer(uint64_t /*bufferId*/){}; | 
|  | 47 |  | 
|  | 48 | virtual bool isProtected() const override { return false; } // mInProtectedContext; } | 
|  | 49 | virtual bool supportsProtectedContent() const override { return false; }; | 
|  | 50 | virtual bool useProtectedContext(bool /*useProtectedContext*/) override { return false; }; | 
|  | 51 | virtual status_t drawLayers(const DisplaySettings& /*display*/, | 
|  | 52 | const std::vector<const LayerSettings*>& /*layers*/, | 
|  | 53 | const sp<GraphicBuffer>& /*buffer*/, | 
|  | 54 | const bool /*useFramebufferCache*/, | 
|  | 55 | base::unique_fd&& /*bufferFence*/, | 
|  | 56 | base::unique_fd* /*drawFence*/) override { | 
|  | 57 | return 0; | 
|  | 58 | }; | 
|  | 59 | virtual bool cleanupPostRender(CleanupMode) override { return true; }; | 
| Alec Mouri | d6f0946 | 2020-12-07 11:18:17 -0800 | [diff] [blame] | 60 | virtual int getContextPriority() override { return 0; } | 
| Leon Scroggins III | 9f3072c | 2021-03-22 10:42:47 -0400 | [diff] [blame] | 61 | virtual void assertShadersCompiled(int numShaders) {} | 
| Nathaniel Nifong | b9f27ef | 2021-04-01 16:44:12 -0400 | [diff] [blame] | 62 | virtual int reportShadersCompiled() { return 0; } | 
| John Reck | 67b1e2b | 2020-08-26 13:17:24 -0700 | [diff] [blame] | 63 | }; | 
|  | 64 |  | 
|  | 65 | } // namespace skia | 
|  | 66 | } // namespace renderengine | 
|  | 67 | } // namespace android | 
|  | 68 |  | 
| Leon Scroggins III | b9216dc | 2021-03-08 17:19:01 -0500 | [diff] [blame] | 69 | #endif /* SF_GLESRENDERENGINE_H_ */ |