Flutter Engine
 
Loading...
Searching...
No Matches
shell_test_platform_view_vulkan.h
Go to the documentation of this file.
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_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_
6#define FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_
7
14#include "third_party/skia/include/gpu/vk/VulkanBackendContext.h"
15#include "third_party/skia/include/gpu/vk/VulkanMemoryAllocator.h"
16#include "third_party/skia/include/gpu/vk/VulkanTypes.h"
17
18namespace flutter::testing {
19
21 public:
23 const TaskRunners& task_runners,
24 std::shared_ptr<ShellTestVsyncClock> vsync_clock,
25 CreateVsyncWaiter create_vsync_waiter,
26 std::shared_ptr<ShellTestExternalViewEmbedder>
27 shell_test_external_view_embedder);
28
30
31 void SimulateVSync() override;
32
33 private:
34 class OffScreenSurface : public flutter::Surface {
35 public:
36 OffScreenSurface(fml::RefPtr<vulkan::VulkanProcTable> vk,
37 std::shared_ptr<ShellTestExternalViewEmbedder>
38 shell_test_external_view_embedder);
39
40 ~OffScreenSurface() override;
41
42 // |Surface|
43 bool IsValid() override;
44
45 // |Surface|
46 std::unique_ptr<SurfaceFrame> AcquireFrame(const DlISize& size) override;
47
48 // |Surface|
49 DlMatrix GetRootTransformation() const override;
50
51 // |Surface|
52 GrDirectContext* GetContext() override;
53
54 private:
55 bool valid_ = false;
57 std::shared_ptr<ShellTestExternalViewEmbedder>
58 shell_test_external_view_embedder_;
59 std::unique_ptr<vulkan::VulkanApplication> application_;
60 std::unique_ptr<vulkan::VulkanDevice> logical_device_;
61 sk_sp<skgpu::VulkanMemoryAllocator> memory_allocator_;
62 sk_sp<GrDirectContext> context_;
63
64 bool CreateSkiaGrContext();
65 bool CreateSkiaBackendContext(skgpu::VulkanBackendContext*,
66 VkPhysicalDeviceFeatures*);
67
68 FML_DISALLOW_COPY_AND_ASSIGN(OffScreenSurface);
69 };
70
71 CreateVsyncWaiter create_vsync_waiter_;
72
73 std::shared_ptr<ShellTestVsyncClock> vsync_clock_;
74
76
77 std::shared_ptr<ShellTestExternalViewEmbedder>
78 shell_test_external_view_embedder_;
79
80 // |PlatformView|
81 std::unique_ptr<Surface> CreateRenderingSurface() override;
82
83 // |PlatformView|
84 std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override;
85
86 // |PlatformView|
87 std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override;
88
89 // |PlatformView|
90 PointerDataDispatcherMaker GetDispatcherMaker() override;
91
93};
94
95} // namespace flutter::testing
96
97#endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_
Used to forward events from the platform view to interested subsystems. This forwarding is done by th...
Abstract Base Class that represents where we will be rendering content.
Definition surface.h:26
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
A 4x4 matrix using column-major storage.
Definition matrix.h:37