1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_TESTING_TEST_VULKAN_SURFACE_IMPL_H_
6#define FLUTTER_TESTING_TEST_VULKAN_SURFACE_IMPL_H_
7
8#include <memory>
9#include "flutter/testing/test_vulkan_context.h"
10
11#include "third_party/skia/include/core/SkRefCnt.h"
12#include "third_party/skia/include/core/SkSize.h"
13#include "third_party/skia/include/core/SkSurface.h"
14#include "third_party/skia/include/gpu/GrDirectContext.h"
15
16namespace flutter {
17
18namespace testing {
19
20class TestVulkanSurface {
21 public:
22 static std::unique_ptr<TestVulkanSurface> Create(
23 const TestVulkanContext& context,
24 const SkISize& surface_size);
25
26 bool IsValid() const;
27
28 sk_sp<SkImage> GetSurfaceSnapshot() const;
29
30 VkImage GetImage();
31
32 private:
33 explicit TestVulkanSurface(TestVulkanImage&& image);
34
35 TestVulkanImage image_;
36 sk_sp<SkSurface> surface_;
37};
38
39} // namespace testing
40} // namespace flutter
41
42#endif // FLUTTER_TESTING_TEST_VULKAN_SURFACE_IMPL_H_
43

source code of flutter_engine/flutter/testing/test_vulkan_surface.h