Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
VkYcbcrSamplerHelper.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google Inc.
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 VkYcbcrSamplerHelper_DEFINED
9#define VkYcbcrSamplerHelper_DEFINED
10
12
13#ifdef SK_VULKAN
14
17
18class GrDirectContext;
19class GrVkGpu;
20
21// This helper will create and hold data for a Vulkan YCbCr backend texture. This format is
22// particularly interesting because its sampler is immutable.
23class VkYcbcrSamplerHelper {
24public:
25 VkYcbcrSamplerHelper(GrDirectContext*);
26 ~VkYcbcrSamplerHelper();
27
28 bool isYCbCrSupported();
29
30 bool createBackendTexture(uint32_t width, uint32_t height);
31
32 const GrBackendTexture& backendTexture() const { return fTexture; }
33
34 static int GetExpectedY(int x, int y, int width, int height);
35 static std::pair<int, int> GetExpectedUV(int x, int y, int width, int height);
36
37private:
38 GrVkGpu* vkGpu();
39
41
42 VkImage fImage = VK_NULL_HANDLE;
43 VkDeviceMemory fImageMemory = VK_NULL_HANDLE;
44 GrBackendTexture fTexture;
45};
46
47#endif // SK_VULKAN
48
49#endif // VkYcbcrSamplerHelper_DEFINED
GrDirectContext * fDContext
double y
double x
int32_t height
int32_t width
#define VK_NULL_HANDLE
Definition vulkan_core.h:46