Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
test_metal_context.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_TESTING_TEST_METAL_CONTEXT_H_
6#define FLUTTER_TESTING_TEST_METAL_CONTEXT_H_
7
8#include <map>
9#include <mutex>
10
13
14namespace flutter {
15
17 public:
18 struct TextureInfo {
19 int64_t texture_id;
20 void* texture;
21 };
22
24
26
27 void* GetMetalDevice() const;
28
29 void* GetMetalCommandQueue() const;
30
32
33 /// Returns texture_id = -1 when texture creation fails.
35
36 bool Present(int64_t texture_id);
37
39
40 private:
41 void* device_;
42 void* command_queue_;
43 sk_sp<GrDirectContext> skia_context_;
44 std::mutex textures_mutex_;
45 int64_t texture_id_ctr_ = 1; // guarded by textures_mutex
46 std::map<int64_t, sk_cfp<void*>> textures_; // guarded by textures_mutex
47};
48
49} // namespace flutter
50
51#endif // FLUTTER_TESTING_TEST_METAL_CONTEXT_H_
TextureInfo GetTextureInfo(int64_t texture_id)
sk_sp< GrDirectContext > GetSkiaContext() const
TextureInfo CreateMetalTexture(const SkISize &size)
Returns texture_id = -1 when texture creation fails.
bool Present(int64_t texture_id)
it will be possible to load the file into Perfetto s trace viewer 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
Definition switches.h:259
int64_t texture_id