| 1 |
/* |
| 2 |
* Copyright 2026 Google LLC |
| 3 |
* |
| 4 |
* Use of this source code is governed by a BSD-style license that can be |
| 5 |
* found in the LICENSE file. |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef AndroidVulkanMemoryAllocator_DEFINED |
| 9 |
#define AndroidVulkanMemoryAllocator_DEFINED |
| 10 |
|
| 11 |
#include "include/core/SkRefCnt.h" |
| 12 |
#include "include/private/base/SkAPI.h" |
| 13 |
|
| 14 |
namespace skgpu { |
| 15 |
struct VulkanBackendContext; |
| 16 |
class VulkanMemoryAllocator; |
| 17 |
} |
| 18 |
|
| 19 |
namespace SkiaVMA { |
| 20 |
|
| 21 |
struct Options { |
| 22 |
bool fThreadSafe = true; |
| 23 |
}; |
| 24 |
|
| 25 |
// Returns a concrete implementation of a memory allocator using some hard-coded settings. |
| 26 |
// If Android Framework ever wants to make their own, they can stop using this. |
| 27 |
sk_sp<skgpu::VulkanMemoryAllocator> Make(const skgpu::VulkanBackendContext&, Options); |
| 28 |
|
| 29 |
} // namespace SkiaVMA |
| 30 |
|
| 31 |
#endif |