blob: 3c5d0cf24d470540f3cd08a0c2f692bf6db015ca [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
36class SkiaRenderEngine : public impl::RenderEngine {
37public:
38 static std::unique_ptr<SkiaRenderEngine> create(const RenderEngineCreationArgs& args);
39 SkiaRenderEngine(const RenderEngineCreationArgs& args) : RenderEngine(args){};
40 ~SkiaRenderEngine() override {}
41
42 virtual void primeCache() const override{};
43 virtual void genTextures(size_t /*count*/, uint32_t* /*names*/) override{};
44 virtual void deleteTextures(size_t /*count*/, uint32_t const* /*names*/) override{};
45 virtual status_t bindExternalTextureBuffer(uint32_t /*texName*/,
46 const sp<GraphicBuffer>& /*buffer*/,
47 const sp<Fence>& /*fence*/) {
48 return 0;
49 }; // EXCLUDES(mRenderingMutex);
50 virtual void cacheExternalTextureBuffer(const sp<GraphicBuffer>& /*buffer*/){};
51 virtual void unbindExternalTextureBuffer(uint64_t /*bufferId*/){};
52
53 virtual bool isProtected() const override { return false; } // mInProtectedContext; }
54 virtual bool supportsProtectedContent() const override { return false; };
55 virtual bool useProtectedContext(bool /*useProtectedContext*/) override { return false; };
56 virtual status_t drawLayers(const DisplaySettings& /*display*/,
57 const std::vector<const LayerSettings*>& /*layers*/,
58 const sp<GraphicBuffer>& /*buffer*/,
59 const bool /*useFramebufferCache*/,
60 base::unique_fd&& /*bufferFence*/,
61 base::unique_fd* /*drawFence*/) override {
62 return 0;
63 };
64 virtual bool cleanupPostRender(CleanupMode) override { return true; };
65};
66
67} // namespace skia
68} // namespace renderengine
69} // namespace android
70
71#endif /* SF_GLESRENDERENGINE_H_ */