#include <GrYUVATextureProxies.h>
Definition at line 18 of file GrYUVATextureProxies.h.
◆ GrYUVATextureProxies() [1/5]
GrYUVATextureProxies::GrYUVATextureProxies |
( |
| ) |
|
|
default |
◆ GrYUVATextureProxies() [2/5]
Assumes all planes are sampled with a default "rgba" swizzle.
Definition at line 30 of file GrYUVATextureProxies.cpp.
35 if (n == 0) {
36 *this = {};
38 return;
39 }
41 for (
int i = 0;
i < n; ++
i) {
43 *this = {};
45 return;
46 }
47 textureChannelMasks[
i] =
proxies[
i]->backendFormat().channelMask();
48 }
50 if (fYUVALocations[0].fPlane < 0) {
51 *this = {};
53 return;
54 }
56 for (
size_t i = 0; i < static_cast<size_t>(n); ++
i) {
58 *this = {};
60 return;
61 }
65 }
67 }
69}
const SkYUVAInfo & yuvaInfo() const
const std::array< sk_sp< GrSurfaceProxy >, SkYUVAInfo::kMaxPlanes > & proxies() const
skgpu::Mipmapped mipmapped() const
GrSurfaceOrigin textureOrigin() const
static constexpr int kMaxPlanes
YUVALocations toYUVALocations(const uint32_t *channelFlags) const
◆ GrYUVATextureProxies() [3/5]
When uploading pixmaps to textures it is important that we account for how the original pixmaps' channels are swizzled into the texture during upload. This will compute a swizzle for each texture based on the original color types and the views' swizzles. The views must all have the same origin or the result will be an invalid GrYUVATextureProxies.
Definition at line 71 of file GrYUVATextureProxies.cpp.
77 if (n == 0) {
78 *this = {};
80 return;
81 }
83 for (
int i = 0;
i < n; ++
i) {
87 if (!views[
i] || views[
i].origin() != views[0].origin()) {
88 *this = {};
90 return;
91 }
94 }
95 }
96
98 if (fYUVALocations[0].fPlane < 0) {
99 *this = {};
101 return;
102 }
103
104
106 int plane = fYUVALocations[
i].fPlane;
107 if (plane >= 0) {
108 int chanAsIdx =
static_cast<int>(fYUVALocations[
i].fChannel);
109 switch (views[plane].swizzle()[chanAsIdx]) {
114
115 default:
116 SkDEBUGFAILF(
"Unexpected swizzle value: %c", views[
i].swizzle()[chanAsIdx]);
117 *this = {};
119 return;
120 }
121 }
122 }
123 for (
int i = 0;
i < n; ++
i) {
125 }
126 fTextureOrigin = views[0].
origin();
128}
static constexpr uint32_t GrColorTypeChannelFlags(GrColorType ct)
static int num_channels(const GrBackendFormat &format)
#define SkDEBUGFAILF(fmt,...)
sk_sp< GrSurfaceProxy > detachProxy()
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy(int i) const
static constexpr int kYUVAChannelCount
◆ GrYUVATextureProxies() [4/5]
◆ GrYUVATextureProxies() [5/5]
◆ isValid()
bool GrYUVATextureProxies::isValid |
( |
| ) |
const |
|
inline |
◆ makeView()
◆ mipmapped()
◆ numPlanes()
int GrYUVATextureProxies::numPlanes |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ proxies()
◆ proxy()
◆ refProxy()
◆ textureOrigin()
◆ yuvaInfo()
const SkYUVAInfo & GrYUVATextureProxies::yuvaInfo |
( |
| ) |
const |
|
inline |
◆ yuvaLocations()
The documentation for this class was generated from the following files: