2018-11-07 12:24:35 -08:00
|
|
|
// Copyright 2013 The Flutter Authors. All rights reserved.
|
2016-03-24 17:06:23 -07:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
2016-10-06 15:06:21 -07:00
|
|
|
#ifndef SHELL_GPU_GPU_SURFACE_VULKAN_H_
|
|
|
|
|
#define SHELL_GPU_GPU_SURFACE_VULKAN_H_
|
2016-09-23 15:33:25 -07:00
|
|
|
|
2017-01-20 14:37:10 -08:00
|
|
|
#include <memory>
|
2018-04-13 13:48:15 -07:00
|
|
|
|
2018-07-26 12:49:34 -07:00
|
|
|
#include "flutter/fml/macros.h"
|
|
|
|
|
#include "flutter/fml/memory/weak_ptr.h"
|
2017-01-20 14:37:10 -08:00
|
|
|
#include "flutter/shell/common/surface.h"
|
|
|
|
|
#include "flutter/vulkan/vulkan_native_surface.h"
|
|
|
|
|
#include "flutter/vulkan/vulkan_window.h"
|
2016-03-24 17:06:23 -07:00
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
namespace flutter {
|
2016-03-24 17:06:23 -07:00
|
|
|
|
2017-01-20 14:37:10 -08:00
|
|
|
class GPUSurfaceVulkan : public Surface {
|
|
|
|
|
public:
|
2018-07-26 12:49:34 -07:00
|
|
|
GPUSurfaceVulkan(fml::RefPtr<vulkan::VulkanProcTable> proc_table,
|
2017-01-20 14:37:10 -08:00
|
|
|
std::unique_ptr<vulkan::VulkanNativeSurface> native_surface);
|
|
|
|
|
|
|
|
|
|
~GPUSurfaceVulkan() override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |Surface|
|
2017-01-20 14:37:10 -08:00
|
|
|
bool IsValid() override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |Surface|
|
2019-12-03 12:02:37 -08:00
|
|
|
std::unique_ptr<SurfaceFrame> AcquireFrame(const SkISize& size) override;
|
2017-01-20 14:37:10 -08:00
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |Surface|
|
2018-08-28 14:13:49 -07:00
|
|
|
SkMatrix GetRootTransformation() const override;
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
// |Surface|
|
2017-01-20 14:37:10 -08:00
|
|
|
GrContext* GetContext() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
vulkan::VulkanWindow window_;
|
2018-07-26 12:49:34 -07:00
|
|
|
fml::WeakPtrFactory<GPUSurfaceVulkan> weak_factory_;
|
2017-01-20 14:37:10 -08:00
|
|
|
|
2018-07-26 12:49:34 -07:00
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan);
|
2017-01-20 14:37:10 -08:00
|
|
|
};
|
2016-03-24 17:06:23 -07:00
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
} // namespace flutter
|
2016-03-24 17:06:23 -07:00
|
|
|
|
2016-10-06 15:06:21 -07:00
|
|
|
#endif // SHELL_GPU_GPU_SURFACE_VULKAN_H_
|