Flutter Engine
The Flutter Engine
tracked_objects_vk.cc
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
6
8
9namespace impeller {
10
12 const std::weak_ptr<const ContextVK>& context,
13 const std::shared_ptr<CommandPoolVK>& pool,
14 std::unique_ptr<GPUProbe> probe)
15 : desc_pool_(context), probe_(std::move(probe)) {
16 if (!pool) {
17 return;
18 }
19 auto buffer = pool->CreateCommandBuffer();
20 if (!buffer) {
21 return;
22 }
23 pool_ = pool;
24 buffer_ = std::move(buffer);
25 is_valid_ = true;
26}
27
29 if (!buffer_) {
30 return;
31 }
32 pool_->CollectCommandBuffer(std::move(buffer_));
33}
34
36 return is_valid_;
37}
38
39void TrackedObjectsVK::Track(std::shared_ptr<SharedObjectVK> object) {
40 if (!object) {
41 return;
42 }
43 tracked_objects_.insert(std::move(object));
44}
45
46void TrackedObjectsVK::Track(std::shared_ptr<const DeviceBuffer> buffer) {
47 if (!buffer) {
48 return;
49 }
50 tracked_buffers_.insert(std::move(buffer));
51}
52
54 const std::shared_ptr<const DeviceBuffer>& buffer) const {
55 if (!buffer) {
56 return false;
57 }
58 return tracked_buffers_.find(buffer) != tracked_buffers_.end();
59}
60
61void TrackedObjectsVK::Track(std::shared_ptr<const TextureSourceVK> texture) {
62 if (!texture) {
63 return;
64 }
65 tracked_textures_.insert(std::move(texture));
66}
67
69 const std::shared_ptr<const TextureSourceVK>& texture) const {
70 if (!texture) {
71 return false;
72 }
73 return tracked_textures_.find(texture) != tracked_textures_.end();
74}
75
76vk::CommandBuffer TrackedObjectsVK::GetCommandBuffer() const {
77 return *buffer_;
78}
79
81 return desc_pool_;
82}
83
85 return *probe_.get();
86}
87
88} // namespace impeller
AutoreleasePool pool
A per-frame descriptor pool. Descriptors from this pool don't need to be freed individually....
GPUProbe & GetGPUProbe() const
TrackedObjectsVK(const std::weak_ptr< const ContextVK > &context, const std::shared_ptr< CommandPoolVK > &pool, std::unique_ptr< GPUProbe > probe)
void Track(std::shared_ptr< SharedObjectVK > object)
DescriptorPoolVK & GetDescriptorPool()
bool IsTracking(const std::shared_ptr< const DeviceBuffer > &buffer) const
vk::CommandBuffer GetCommandBuffer() const
FlTexture * texture
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
Definition: ref_ptr.h:256