blob: 52bc500a5a9fc280f5c46971c2a3700976274132 [file] [log] [blame]
Ian Elliott1f0911e2022-09-09 16:31:47 -06001/*
2 * Copyright 2022 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_SKIAVKRENDERENGINE_H_
18#define SF_SKIAVKRENDERENGINE_H_
19
20#include <vk/GrVkBackendContext.h>
21
22#include "SkiaRenderEngine.h"
23
24namespace android {
25namespace renderengine {
26namespace skia {
27
28class SkiaVkRenderEngine : public SkiaRenderEngine {
29public:
Ian Elliott1f0911e2022-09-09 16:31:47 -060030 static std::unique_ptr<SkiaVkRenderEngine> create(const RenderEngineCreationArgs& args);
31 ~SkiaVkRenderEngine() override;
32
33 int getContextPriority() override;
34
35protected:
36 // Implementations of abstract SkiaRenderEngine functions specific to
37 // rendering backend
38 virtual SkiaRenderEngine::Contexts createDirectContexts(const GrContextOptions& options);
39 bool supportsProtectedContentImpl() const override;
40 bool useProtectedContextImpl(GrProtected isProtected) override;
41 void waitFence(GrDirectContext* grContext, base::borrowed_fd fenceFd) override;
42 base::unique_fd flushAndSubmit(GrDirectContext* context) override;
43 void appendBackendSpecificInfoToDump(std::string& result) override;
44
45private:
46 SkiaVkRenderEngine(const RenderEngineCreationArgs& args);
47 base::unique_fd flush();
48
49 GrVkBackendContext mBackendContext;
50};
51
52} // namespace skia
53} // namespace renderengine
54} // namespace android
55
Ian Elliottbe705072023-01-04 08:31:37 -070056#endif