Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
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....
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
static const uint8_t buffer[]
FlTexture * texture
Definition ref_ptr.h:256