diff options
Diffstat (limited to 'include/gpu/vk/GrVkExtensions.h')
-rw-r--r-- | include/gpu/vk/GrVkExtensions.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/gpu/vk/GrVkExtensions.h b/include/gpu/vk/GrVkExtensions.h new file mode 100644 index 0000000000..a6badcd33f --- /dev/null +++ b/include/gpu/vk/GrVkExtensions.h @@ -0,0 +1,35 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrVkExtensions_DEFINED +#define GrVkExtensions_DEFINED + +#include "../private/SkTArray.h" +#include "SkString.h" + +/** + * Helper class that eats in an array of extensions strings for instance and device and allows for + * quicker querying if an extension is present. + */ +class GrVkExtensions { +public: + GrVkExtensions(uint32_t instanceExtensionCount, const char* const* instanceExtensions, + uint32_t deviceExtensionCount, const char* const* deviceExtensions); + // TODO: Remove once we remove the old fExtensions from GrVkBackendContext + GrVkExtensions(uint32_t extensionFlags); + + // TODO: Remove once we remove the old fExtensions from GrVkBackendContext + static void GetExtensionArrayFromFlags(uint32_t extensionFlags, + SkTArray<const char*>* extensions); + + bool hasExtension(const char[]) const; + +private: + SkTArray<SkString> fExtensionStrings; +}; + +#endif |