Files

47 lines
1.2 KiB
C++
Raw Permalink Normal View History

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.
#ifndef SHELL_GPU_GPU_SURFACE_VULKAN_H_
#define SHELL_GPU_GPU_SURFACE_VULKAN_H_
#include <memory>
2018-07-26 12:49:34 -07:00
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/weak_ptr.h"
#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
namespace flutter {
2016-03-24 17:06:23 -07:00
class GPUSurfaceVulkan : public Surface {
public:
2018-07-26 12:49:34 -07:00
GPUSurfaceVulkan(fml::RefPtr<vulkan::VulkanProcTable> proc_table,
std::unique_ptr<vulkan::VulkanNativeSurface> native_surface);
~GPUSurfaceVulkan() override;
// |Surface|
bool IsValid() override;
// |Surface|
std::unique_ptr<SurfaceFrame> AcquireFrame(const SkISize& size) override;
// |Surface|
SkMatrix GetRootTransformation() const override;
// |Surface|
GrContext* GetContext() override;
private:
vulkan::VulkanWindow window_;
2018-07-26 12:49:34 -07:00
fml::WeakPtrFactory<GPUSurfaceVulkan> weak_factory_;
2018-07-26 12:49:34 -07:00
FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan);
};
2016-03-24 17:06:23 -07:00
} // namespace flutter
2016-03-24 17:06:23 -07:00
#endif // SHELL_GPU_GPU_SURFACE_VULKAN_H_