Split Ganesh-specific parts of SkiaVkRenderEngine into subclass
Similarly to Ia65306cc825b71fe0b89c7f8545ce1c71a81d86b, this will allow
for a Graphite-specific variant of SkiaVkRenderEngine.
waitFence and flushAndSubmit are kept on the *RenderEngine classes (as
opposed to the recently added SkiaGpuContext abstraction) because they
are specific to the intersection of both <Skia backend> x <GPU API>,
with 3 variants. Their logic is also RE-specific, and not suitable for
a Skia abstraction.
Misc. cleanup:
- Remove SkiaVkRenderEngine's flush() and mBackendContext declarations
as they were undefined and unnecessary.
- Mark some local variables as const.
- Pass named constant to GrDirectContext::wait in
GaneshVkRenderEngine::waitFence
Test: manual validation & existing tests (refactor)
Bug: b/293371537
Change-Id: I695a0554b20ca14cf475aeff1b92c4445c1af55b
diff --git a/libs/renderengine/skia/GaneshVkRenderEngine.h b/libs/renderengine/skia/GaneshVkRenderEngine.h
new file mode 100644
index 0000000..90e2487
--- /dev/null
+++ b/libs/renderengine/skia/GaneshVkRenderEngine.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "skia/SkiaVkRenderEngine.h"
+
+namespace android::renderengine::skia {
+
+class GaneshVkRenderEngine : public SkiaVkRenderEngine {
+ friend std::unique_ptr<SkiaVkRenderEngine> SkiaVkRenderEngine::create(
+ const RenderEngineCreationArgs& args);
+
+protected:
+ GaneshVkRenderEngine(const RenderEngineCreationArgs& args) : SkiaVkRenderEngine(args) {}
+
+ void waitFence(SkiaGpuContext* context, base::borrowed_fd fenceFd) override;
+ base::unique_fd flushAndSubmit(SkiaGpuContext* context) override;
+};
+
+} // namespace android::renderengine::skia