2018-11-07 12:24:35 -08:00
|
|
|
// Copyright 2013 The Flutter Authors. All rights reserved.
|
2017-01-20 14:37:10 -08:00
|
|
|
// 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_
|
|
|
|
|
|
2017-05-31 17:27:47 -07:00
|
|
|
#include <jni.h>
|
2017-01-20 14:37:10 -08:00
|
|
|
#include <memory>
|
2018-07-26 12:49:34 -07:00
|
|
|
#include "flutter/fml/macros.h"
|
2017-01-20 14:37:10 -08:00
|
|
|
#include "flutter/shell/platform/android/android_native_window.h"
|
|
|
|
|
#include "flutter/shell/platform/android/android_surface.h"
|
|
|
|
|
#include "flutter/vulkan/vulkan_window.h"
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
namespace flutter {
|
2017-01-20 14:37:10 -08:00
|
|
|
|
|
|
|
|
class AndroidSurfaceVulkan : public AndroidSurface {
|
|
|
|
|
public:
|
|
|
|
|
AndroidSurfaceVulkan();
|
|
|
|
|
|
|
|
|
|
~AndroidSurfaceVulkan() override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2017-01-20 14:37:10 -08:00
|
|
|
bool IsValid() const override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2018-04-12 18:28:55 +02:00
|
|
|
std::unique_ptr<Surface> CreateGPUSurface() override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2018-04-13 13:48:15 -07:00
|
|
|
void TeardownOnScreenContext() override;
|
2018-04-12 18:28:55 +02:00
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2017-01-20 14:37:10 -08:00
|
|
|
bool OnScreenSurfaceResize(const SkISize& size) const override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2017-01-20 14:37:10 -08:00
|
|
|
bool ResourceContextMakeCurrent() override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2018-08-14 22:20:05 -07:00
|
|
|
bool ResourceContextClearCurrent() override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |AndroidSurface|
|
2018-07-26 12:49:34 -07:00
|
|
|
bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) override;
|
2017-01-20 14:37:10 -08:00
|
|
|
|
|
|
|
|
private:
|
2018-07-26 12:49:34 -07:00
|
|
|
fml::RefPtr<vulkan::VulkanProcTable> proc_table_;
|
|
|
|
|
fml::RefPtr<AndroidNativeWindow> native_window_;
|
2017-01-20 14:37:10 -08:00
|
|
|
|
2018-07-26 12:49:34 -07:00
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceVulkan);
|
2017-01-20 14:37:10 -08:00
|
|
|
};
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
} // namespace flutter
|
2017-01-20 14:37:10 -08:00
|
|
|
|
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
|