blob: 308c5ffa9faa3f18d5cb67e774fbfe055484ed96 [file] [log] [blame]
John Reck67b1e2b2020-08-26 13:17:24 -07001/*
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
23namespace android {
24
25namespace renderengine {
26
27class Mesh;
28class Texture;
29
30namespace skia {
31
32class 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 Mouri081be4c2020-09-16 10:24:47 -070036class SkiaRenderEngine : public RenderEngine {
John Reck67b1e2b2020-08-26 13:17:24 -070037public:
38 static std::unique_ptr<SkiaRenderEngine> create(const RenderEngineCreationArgs& args);
Alec Mouri0d995102021-02-24 16:53:38 -080039 SkiaRenderEngine(RenderEngineType type) : RenderEngine(type) {}
John Reck67b1e2b2020-08-26 13:17:24 -070040 ~SkiaRenderEngine() override {}
41
Leon Scroggins IIIb9216dc2021-03-08 17:19:01 -050042 virtual void primeCache() override{};
John Reck67b1e2b2020-08-26 13:17:24 -070043 virtual void genTextures(size_t /*count*/, uint32_t* /*names*/) override{};
44 virtual void deleteTextures(size_t /*count*/, uint32_t const* /*names*/) override{};
John Reck67b1e2b2020-08-26 13:17:24 -070045 virtual bool isProtected() const override { return false; } // mInProtectedContext; }
46 virtual bool supportsProtectedContent() const override { return false; };
47 virtual bool useProtectedContext(bool /*useProtectedContext*/) override { return false; };
48 virtual status_t drawLayers(const DisplaySettings& /*display*/,
49 const std::vector<const LayerSettings*>& /*layers*/,
Alec Mouria90a5702021-04-16 16:36:21 +000050 const std::shared_ptr<ExternalTexture>& /*buffer*/,
John Reck67b1e2b2020-08-26 13:17:24 -070051 const bool /*useFramebufferCache*/,
52 base::unique_fd&& /*bufferFence*/,
53 base::unique_fd* /*drawFence*/) override {
54 return 0;
55 };
56 virtual bool cleanupPostRender(CleanupMode) override { return true; };
Alec Mourid6f09462020-12-07 11:18:17 -080057 virtual int getContextPriority() override { return 0; }
Leon Scroggins III9f3072c2021-03-22 10:42:47 -040058 virtual void assertShadersCompiled(int numShaders) {}
Nathaniel Nifongb9f27ef2021-04-01 16:44:12 -040059 virtual int reportShadersCompiled() { return 0; }
Alec Mouria90a5702021-04-16 16:36:21 +000060
61protected:
62 virtual void mapExternalTextureBuffer(const sp<GraphicBuffer>& /*buffer*/,
63 bool /*isRenderable*/) override;
64 virtual void unmapExternalTextureBuffer(const sp<GraphicBuffer>& /*buffer*/) override;
John Reck67b1e2b2020-08-26 13:17:24 -070065};
66
67} // namespace skia
68} // namespace renderengine
69} // namespace android
70
Leon Scroggins IIIb9216dc2021-03-08 17:19:01 -050071#endif /* SF_GLESRENDERENGINE_H_ */