mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
796259c089
* Enable software rendering backend on android. Add "enable-software-rendering" flag. * Fix variable naming and threading.
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
// Copyright 2016 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
|
|
#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
|
|
|
|
#include <jni.h>
|
|
#include <memory>
|
|
#include "flutter/shell/platform/android/android_native_window.h"
|
|
#include "flutter/shell/platform/android/android_surface.h"
|
|
#include "flutter/vulkan/vulkan_window.h"
|
|
#include "lib/ftl/macros.h"
|
|
|
|
namespace shell {
|
|
|
|
class AndroidSurfaceVulkan : public AndroidSurface {
|
|
public:
|
|
AndroidSurfaceVulkan();
|
|
|
|
~AndroidSurfaceVulkan() override;
|
|
|
|
bool IsValid() const override;
|
|
|
|
void TeardownOnScreenContext() override;
|
|
|
|
std::unique_ptr<Surface> CreateGPUSurface() override;
|
|
|
|
SkISize OnScreenSurfaceSize() const override;
|
|
|
|
bool OnScreenSurfaceResize(const SkISize& size) const override;
|
|
|
|
bool ResourceContextMakeCurrent() override;
|
|
|
|
bool SetNativeWindow(ftl::RefPtr<AndroidNativeWindow> window,
|
|
PlatformView::SurfaceConfig config) override;
|
|
|
|
void SetFlutterView(
|
|
const fml::jni::JavaObjectWeakGlobalRef& flutter_view) override;
|
|
|
|
private:
|
|
ftl::RefPtr<vulkan::VulkanProcTable> proc_table_;
|
|
ftl::RefPtr<AndroidNativeWindow> native_window_;
|
|
|
|
FTL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceVulkan);
|
|
};
|
|
|
|
} // namespace shell
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
|