blob: 1f56c848f8734c7b4de09ff771553045f72e7bcd [file] [log] [blame]
Greg Daniel94403452017-04-18 15:52:36 -04001/*
2 * Copyright 2017 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 GrBackendSurface_DEFINED
9#define GrBackendSurface_DEFINED
10
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/gpu/GrTypes.h"
12#include "include/gpu/gl/GrGLTypes.h"
13#include "include/gpu/mock/GrMockTypes.h"
14#include "include/gpu/vk/GrVkTypes.h"
Brian Salomone2826ab2019-06-04 15:58:31 -040015#include "include/private/GrGLTypesPriv.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050016#include "include/private/GrVkTypesPriv.h"
Greg Daniel52e16d92018-04-10 09:34:07 -040017
18class GrVkImageLayout;
Brian Salomone2826ab2019-06-04 15:58:31 -040019class GrGLTextureParameters;
Greg Daniel94403452017-04-18 15:52:36 -040020
Timothy Liang4e85e802018-06-28 16:37:18 -040021#ifdef SK_METAL
Mike Kleinc0bd9f92019-04-23 12:05:21 -050022#include "include/gpu/mtl/GrMtlTypes.h"
Timothy Liang4e85e802018-06-28 16:37:18 -040023#endif
24
Robert Phillips8caf85f2018-04-05 09:30:38 -040025#if !SK_SUPPORT_GPU
26
27// SkSurface and SkImage rely on a minimal version of these always being available
28class SK_API GrBackendTexture {
29public:
30 GrBackendTexture() {}
31
32 bool isValid() const { return false; }
33};
34
35class SK_API GrBackendRenderTarget {
36public:
37 GrBackendRenderTarget() {}
38
39 bool isValid() const { return false; }
40};
41#else
42
Robert Phillipsfc711a22018-02-13 17:03:00 -050043class SK_API GrBackendFormat {
44public:
45 // Creates an invalid backend format.
46 GrBackendFormat() : fValid(false) {}
47
48 static GrBackendFormat MakeGL(GrGLenum format, GrGLenum target) {
49 return GrBackendFormat(format, target);
50 }
51
Greg Daniela8d92112018-03-09 12:05:04 -050052 static GrBackendFormat MakeVk(VkFormat format) {
Greg Daniel7e000222018-12-03 10:08:21 -050053 return GrBackendFormat(format, GrVkYcbcrConversionInfo());
Robert Phillipsfc711a22018-02-13 17:03:00 -050054 }
Robert Phillipsfc711a22018-02-13 17:03:00 -050055
Greg Daniel7e000222018-12-03 10:08:21 -050056 // This is used for external textures and the VkFormat is assumed to be VK_FORMAT_UNDEFINED.
57 // This call is only supported on Android since the GrVkYcbcrConvesionInfo contains an android
58 // external format.
59 static GrBackendFormat MakeVk(const GrVkYcbcrConversionInfo& ycbcrInfo);
60
Timothy Liang4e85e802018-06-28 16:37:18 -040061#ifdef SK_METAL
62 static GrBackendFormat MakeMtl(GrMTLPixelFormat format) {
63 return GrBackendFormat(format);
64 }
65#endif
66
Robert Phillipsfc711a22018-02-13 17:03:00 -050067 static GrBackendFormat MakeMock(GrPixelConfig config) {
68 return GrBackendFormat(config);
69 }
70
Greg Daniel45723ac2018-11-30 10:12:43 -050071 bool operator==(const GrBackendFormat& that) const;
72 bool operator!=(const GrBackendFormat& that) const { return !(*this == that); }
73
Greg Daniel4065d452018-11-16 15:43:41 -050074 GrBackendApi backend() const { return fBackend; }
75 GrTextureType textureType() const { return fTextureType; }
Robert Phillipsfc711a22018-02-13 17:03:00 -050076
77 // If the backend API is GL, these return a pointer to the format and target. Otherwise
78 // it returns nullptr.
79 const GrGLenum* getGLFormat() const;
80 const GrGLenum* getGLTarget() const;
81
Robert Phillipsfc711a22018-02-13 17:03:00 -050082 // If the backend API is Vulkan, this returns a pointer to a VkFormat. Otherwise
83 // it returns nullptr
84 const VkFormat* getVkFormat() const;
Robert Phillipsfc711a22018-02-13 17:03:00 -050085
Greg Daniel7e000222018-12-03 10:08:21 -050086 const GrVkYcbcrConversionInfo* getVkYcbcrConversionInfo() const;
87
Timothy Liang4e85e802018-06-28 16:37:18 -040088#ifdef SK_METAL
89 // If the backend API is Metal, this returns a pointer to a GrMTLPixelFormat. Otherwise
90 // it returns nullptr
91 const GrMTLPixelFormat* getMtlFormat() const;
92#endif
93
Robert Phillipsfc711a22018-02-13 17:03:00 -050094 // If the backend API is Mock, this returns a pointer to a GrPixelConfig. Otherwise
95 // it returns nullptr.
96 const GrPixelConfig* getMockFormat() const;
97
Greg Daniel387ec9a2019-03-07 16:44:54 -050098 // If possible, copies the GrBackendFormat and forces the texture type to be Texture2D. If the
99 // GrBackendFormat was for Vulkan and it originally had a GrVkYcbcrConversionInfo, we will
100 // remove the conversion and set the format to be VK_FORMAT_R8G8B8A8_UNORM.
Greg Daniel4065d452018-11-16 15:43:41 -0500101 GrBackendFormat makeTexture2D() const;
102
Robert Phillipsfc711a22018-02-13 17:03:00 -0500103 // Returns true if the backend format has been initialized.
104 bool isValid() const { return fValid; }
105
106private:
107 GrBackendFormat(GrGLenum format, GrGLenum target);
108
Greg Daniel7e000222018-12-03 10:08:21 -0500109 GrBackendFormat(const VkFormat vkFormat, const GrVkYcbcrConversionInfo&);
Robert Phillipsfc711a22018-02-13 17:03:00 -0500110
Timothy Liang4e85e802018-06-28 16:37:18 -0400111#ifdef SK_METAL
112 GrBackendFormat(const GrMTLPixelFormat mtlFormat);
113#endif
114
Robert Phillipsfc711a22018-02-13 17:03:00 -0500115 GrBackendFormat(const GrPixelConfig config);
116
Greg Danielbdf12ad2018-10-12 09:31:11 -0400117 GrBackendApi fBackend;
Robert Phillips9dbcdcc2019-05-13 10:40:06 -0400118 bool fValid;
Robert Phillipsfc711a22018-02-13 17:03:00 -0500119
120 union {
Greg Daniel4065d452018-11-16 15:43:41 -0500121 GrGLenum fGLFormat; // the sized, internal format of the GL resource
Greg Daniel7e000222018-12-03 10:08:21 -0500122 struct {
123 VkFormat fFormat;
124 GrVkYcbcrConversionInfo fYcbcrConversionInfo;
Robert Phillips9dbcdcc2019-05-13 10:40:06 -0400125 } fVk;
Timothy Liang4e85e802018-06-28 16:37:18 -0400126#ifdef SK_METAL
127 GrMTLPixelFormat fMtlFormat;
128#endif
129 GrPixelConfig fMockFormat;
Robert Phillipsfc711a22018-02-13 17:03:00 -0500130 };
Greg Daniel4065d452018-11-16 15:43:41 -0500131 GrTextureType fTextureType;
Robert Phillipsfc711a22018-02-13 17:03:00 -0500132};
133
Brian Salomonec045b42017-07-07 10:34:40 -0400134class SK_API GrBackendTexture {
Greg Daniel94403452017-04-18 15:52:36 -0400135public:
Brian Salomon8fe24272017-07-07 12:56:11 -0400136 // Creates an invalid backend texture.
Greg Daniel9ca30652018-04-06 09:27:20 -0400137 GrBackendTexture() : fIsValid(false) {}
Brian Salomon8fe24272017-07-07 12:56:11 -0400138
Greg Daniele7d8da42017-12-04 11:23:19 -0500139 // The GrGLTextureInfo must have a valid fFormat.
140 GrBackendTexture(int width,
141 int height,
142 GrMipMapped,
143 const GrGLTextureInfo& glInfo);
144
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000145 GrBackendTexture(int width,
146 int height,
147 const GrVkImageInfo& vkInfo);
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000148
Timothy Liang4e85e802018-06-28 16:37:18 -0400149#ifdef SK_METAL
150 GrBackendTexture(int width,
151 int height,
152 GrMipMapped,
153 const GrMtlTextureInfo& mtlInfo);
154#endif
155
Brian Salomon8fe24272017-07-07 12:56:11 -0400156 GrBackendTexture(int width,
157 int height,
Greg Daniel177e6952017-10-12 12:27:11 -0400158 GrMipMapped,
159 const GrMockTextureInfo& mockInfo);
160
Greg Daniel52e16d92018-04-10 09:34:07 -0400161 GrBackendTexture(const GrBackendTexture& that);
162
163 ~GrBackendTexture();
164
165 GrBackendTexture& operator=(const GrBackendTexture& that);
166
Greg Daniel94403452017-04-18 15:52:36 -0400167 int width() const { return fWidth; }
168 int height() const { return fHeight; }
Greg Daniel177e6952017-10-12 12:27:11 -0400169 bool hasMipMaps() const { return GrMipMapped::kYes == fMipMapped; }
Greg Danielbdf12ad2018-10-12 09:31:11 -0400170 GrBackendApi backend() const {return fBackend; }
Greg Daniel94403452017-04-18 15:52:36 -0400171
Greg Daniel52e16d92018-04-10 09:34:07 -0400172 // If the backend API is GL, copies a snapshot of the GrGLTextureInfo struct into the passed in
173 // pointer and returns true. Otherwise returns false if the backend API is not GL.
174 bool getGLTextureInfo(GrGLTextureInfo*) const;
Greg Danielc0f8e422017-06-13 13:47:53 -0400175
Brian Salomone2826ab2019-06-04 15:58:31 -0400176 // Call this to indicate that the texture parameters have been modified in the GL context
177 // externally to GrContext.
178 void glTextureParametersModified();
179
Greg Daniel323fbcf2018-04-10 13:46:30 -0400180 // If the backend API is Vulkan, copies a snapshot of the GrVkImageInfo struct into the passed
Greg Daniel52e16d92018-04-10 09:34:07 -0400181 // in pointer and returns true. This snapshot will set the fImageLayout to the current layout
182 // state. Otherwise returns false if the backend API is not Vulkan.
183 bool getVkImageInfo(GrVkImageInfo*) const;
184
Greg Daniel323fbcf2018-04-10 13:46:30 -0400185 // Anytime the client changes the VkImageLayout of the VkImage captured by this
186 // GrBackendTexture, they must call this function to notify Skia of the changed layout.
Greg Daniel52e16d92018-04-10 09:34:07 -0400187 void setVkImageLayout(VkImageLayout);
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000188
Timothy Liang4e85e802018-06-28 16:37:18 -0400189#ifdef SK_METAL
190 // If the backend API is Metal, copies a snapshot of the GrMtlTextureInfo struct into the passed
191 // in pointer and returns true. Otherwise returns false if the backend API is not Metal.
192 bool getMtlTextureInfo(GrMtlTextureInfo*) const;
193#endif
194
Brian Salomonf391d0f2018-12-14 09:18:50 -0500195 // Get the GrBackendFormat for this texture (or an invalid format if this is not valid).
196 GrBackendFormat getBackendFormat() const;
197
Greg Daniel52e16d92018-04-10 09:34:07 -0400198 // If the backend API is Mock, copies a snapshot of the GrMockTextureInfo struct into the passed
199 // in pointer and returns true. Otherwise returns false if the backend API is not Mock.
200 bool getMockTextureInfo(GrMockTextureInfo*) const;
Brian Salomon8fe24272017-07-07 12:56:11 -0400201
Eric Karl914a36b2017-10-12 12:44:50 -0700202 // Returns true if the backend texture has been initialized.
Greg Daniel9ca30652018-04-06 09:27:20 -0400203 bool isValid() const { return fIsValid; }
Brian Salomon8fe24272017-07-07 12:56:11 -0400204
Brian Salomonaad83152019-05-24 10:16:35 -0400205 // Returns true if both textures are valid and refer to the same API texture.
206 bool isSameTexture(const GrBackendTexture&);
207
Robert Phillipsc5509952018-04-04 15:54:55 -0400208#if GR_TEST_UTILS
Greg Daniel108bb232018-07-03 16:18:29 -0400209 // We can remove the pixelConfig getter and setter once we remove the GrPixelConfig from the
210 // GrBackendTexture and plumb the GrPixelconfig manually throughout our code (or remove all use
211 // of GrPixelConfig in general).
212 GrPixelConfig pixelConfig() const { return fConfig; }
213 void setPixelConfig(GrPixelConfig config) { fConfig = config; }
214
Robert Phillipsc5509952018-04-04 15:54:55 -0400215 static bool TestingOnly_Equals(const GrBackendTexture& , const GrBackendTexture&);
216#endif
Greg Daniel2a303902018-02-20 10:25:54 -0500217
Eric Karl914a36b2017-10-12 12:44:50 -0700218private:
Greg Daniel5254ccc2017-11-13 11:05:52 -0500219 // Friending for access to the GrPixelConfig
Greg Danielfaa095e2017-12-19 13:15:02 -0500220 friend class SkImage;
Brian Salomon6a426c12018-03-15 12:16:02 -0400221 friend class SkImage_Gpu;
Jim Van Verth8bbce0e2018-10-08 14:34:52 -0400222 friend class SkImage_GpuBase;
Jim Van Verthf49262d2018-10-02 12:07:20 -0400223 friend class SkImage_GpuYUVA;
Jim Van Verth8bbce0e2018-10-08 14:34:52 -0400224 friend class SkPromiseImageHelper;
Greg Daniel5254ccc2017-11-13 11:05:52 -0500225 friend class SkSurface;
Brian Salomonaad83152019-05-24 10:16:35 -0400226 friend class SkSurface_Gpu;
Greg Daniel108bb232018-07-03 16:18:29 -0400227 friend class GrAHardwareBufferImageGenerator;
Greg Daniele728f672018-01-17 10:52:04 -0500228 friend class GrBackendTextureImageGenerator;
Greg Danielf2336e42018-01-23 16:38:14 -0500229 friend class GrProxyProvider;
Greg Daniel5254ccc2017-11-13 11:05:52 -0500230 friend class GrGpu;
231 friend class GrGLGpu;
232 friend class GrVkGpu;
Timothy Liang4e85e802018-06-28 16:37:18 -0400233 friend class GrMtlGpu;
Greg Daniel057627f2018-03-14 15:51:58 -0400234 friend class PromiseImageHelper;
Robert Phillipsc5509952018-04-04 15:54:55 -0400235
Greg Daniel5254ccc2017-11-13 11:05:52 -0500236 GrPixelConfig config() const { return fConfig; }
237
Brian Salomone2826ab2019-06-04 15:58:31 -0400238#ifdef SK_GL
239 friend class GrGLTexture;
240 GrBackendTexture(int width,
241 int height,
242 GrMipMapped,
243 const GrGLTextureInfo,
244 sk_sp<GrGLTextureParameters>);
245 sk_sp<GrGLTextureParameters> getGLTextureParams() const;
246#endif
Greg Daniel52e16d92018-04-10 09:34:07 -0400247
Greg Danielb4d89562018-10-03 18:44:49 +0000248#ifdef SK_VULKAN
Brian Salomone2826ab2019-06-04 15:58:31 -0400249 friend class GrVkTexture;
250 GrBackendTexture(int width,
251 int height,
252 const GrVkImageInfo& vkInfo,
253 sk_sp<GrVkImageLayout> layout);
254 sk_sp<GrVkImageLayout> getGrVkImageLayout() const;
Greg Daniel52e16d92018-04-10 09:34:07 -0400255#endif
256
257 // Free and release and resources being held by the GrBackendTexture.
258 void cleanup();
259
Greg Daniel9ca30652018-04-06 09:27:20 -0400260 bool fIsValid;
Greg Daniel94403452017-04-18 15:52:36 -0400261 int fWidth; //<! width in pixels
262 int fHeight; //<! height in pixels
263 GrPixelConfig fConfig;
Greg Daniel177e6952017-10-12 12:27:11 -0400264 GrMipMapped fMipMapped;
Greg Danielbdf12ad2018-10-12 09:31:11 -0400265 GrBackendApi fBackend;
Greg Daniel94403452017-04-18 15:52:36 -0400266
267 union {
Brian Salomone2826ab2019-06-04 15:58:31 -0400268#ifdef SK_GL
269 GrGLBackendTextureInfo fGLInfo;
270#endif
Greg Daniel52e16d92018-04-10 09:34:07 -0400271 GrVkBackendSurfaceInfo fVkInfo;
Brian Salomon8fe24272017-07-07 12:56:11 -0400272 GrMockTextureInfo fMockInfo;
Greg Daniel94403452017-04-18 15:52:36 -0400273 };
Jim Van Verthdac1e552019-05-31 09:10:55 -0400274#ifdef SK_METAL
275 GrMtlTextureInfo fMtlInfo;
276#endif
Greg Daniel94403452017-04-18 15:52:36 -0400277};
278
Brian Salomonec045b42017-07-07 10:34:40 -0400279class SK_API GrBackendRenderTarget {
Greg Daniel94403452017-04-18 15:52:36 -0400280public:
Robert Phillips57e08282017-11-16 14:59:48 -0500281 // Creates an invalid backend texture.
Greg Daniel9ca30652018-04-06 09:27:20 -0400282 GrBackendRenderTarget() : fIsValid(false) {}
Robert Phillips57e08282017-11-16 14:59:48 -0500283
Greg Danielfaa095e2017-12-19 13:15:02 -0500284 // The GrGLTextureInfo must have a valid fFormat.
285 GrBackendRenderTarget(int width,
286 int height,
287 int sampleCnt,
288 int stencilBits,
289 const GrGLFramebufferInfo& glInfo);
290
Brian Salomonafdc6b12018-03-09 12:02:32 -0500291 /** Deprecated, use version that does not take stencil bits. */
Greg Daniel94403452017-04-18 15:52:36 -0400292 GrBackendRenderTarget(int width,
293 int height,
294 int sampleCnt,
295 int stencilBits,
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000296 const GrVkImageInfo& vkInfo);
Brian Salomonafdc6b12018-03-09 12:02:32 -0500297 GrBackendRenderTarget(int width, int height, int sampleCnt, const GrVkImageInfo& vkInfo);
Greg Daniel94403452017-04-18 15:52:36 -0400298
Timothy Liang4e85e802018-06-28 16:37:18 -0400299#ifdef SK_METAL
300 GrBackendRenderTarget(int width,
301 int height,
302 int sampleCnt,
303 const GrMtlTextureInfo& mtlInfo);
304#endif
305
Brian Salomon0c51eea2018-03-09 17:02:09 -0500306 GrBackendRenderTarget(int width,
307 int height,
308 int sampleCnt,
309 int stencilBits,
310 const GrMockRenderTargetInfo& mockInfo);
311
Greg Daniel323fbcf2018-04-10 13:46:30 -0400312 ~GrBackendRenderTarget();
313
314 GrBackendRenderTarget(const GrBackendRenderTarget& that);
315 GrBackendRenderTarget& operator=(const GrBackendRenderTarget&);
316
Greg Daniel94403452017-04-18 15:52:36 -0400317 int width() const { return fWidth; }
318 int height() const { return fHeight; }
319 int sampleCnt() const { return fSampleCnt; }
320 int stencilBits() const { return fStencilBits; }
Greg Danielbdf12ad2018-10-12 09:31:11 -0400321 GrBackendApi backend() const {return fBackend; }
Greg Daniel94403452017-04-18 15:52:36 -0400322
Greg Daniel323fbcf2018-04-10 13:46:30 -0400323 // If the backend API is GL, copies a snapshot of the GrGLFramebufferInfo struct into the passed
324 // in pointer and returns true. Otherwise returns false if the backend API is not GL.
325 bool getGLFramebufferInfo(GrGLFramebufferInfo*) const;
Greg Danielc0f8e422017-06-13 13:47:53 -0400326
Greg Daniel323fbcf2018-04-10 13:46:30 -0400327 // If the backend API is Vulkan, copies a snapshot of the GrVkImageInfo struct into the passed
328 // in pointer and returns true. This snapshot will set the fImageLayout to the current layout
329 // state. Otherwise returns false if the backend API is not Vulkan.
330 bool getVkImageInfo(GrVkImageInfo*) const;
331
332 // Anytime the client changes the VkImageLayout of the VkImage captured by this
333 // GrBackendRenderTarget, they must call this function to notify Skia of the changed layout.
334 void setVkImageLayout(VkImageLayout);
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000335
Timothy Liang4e85e802018-06-28 16:37:18 -0400336#ifdef SK_METAL
337 // If the backend API is Metal, copies a snapshot of the GrMtlTextureInfo struct into the passed
338 // in pointer and returns true. Otherwise returns false if the backend API is not Metal.
339 bool getMtlTextureInfo(GrMtlTextureInfo*) const;
340#endif
341
Greg Daniel323fbcf2018-04-10 13:46:30 -0400342 // If the backend API is Mock, copies a snapshot of the GrMockTextureInfo struct into the passed
343 // in pointer and returns true. Otherwise returns false if the backend API is not Mock.
344 bool getMockRenderTargetInfo(GrMockRenderTargetInfo*) const;
Brian Salomon0c51eea2018-03-09 17:02:09 -0500345
Robert Phillips57e08282017-11-16 14:59:48 -0500346 // Returns true if the backend texture has been initialized.
Greg Daniel9ca30652018-04-06 09:27:20 -0400347 bool isValid() const { return fIsValid; }
Robert Phillips57e08282017-11-16 14:59:48 -0500348
Robert Phillips8caf85f2018-04-05 09:30:38 -0400349
350#if GR_TEST_UTILS
Greg Daniel108bb232018-07-03 16:18:29 -0400351 // We can remove the pixelConfig getter and setter once we remove the pixel config from the
352 // GrBackendRenderTarget and plumb the pixel config manually throughout our code (or remove all
353 // use of GrPixelConfig in general).
354 GrPixelConfig pixelConfig() const { return fConfig; }
355 void setPixelConfig(GrPixelConfig config) { fConfig = config; }
356
Robert Phillips8caf85f2018-04-05 09:30:38 -0400357 static bool TestingOnly_Equals(const GrBackendRenderTarget&, const GrBackendRenderTarget&);
358#endif
Greg Daniel2a303902018-02-20 10:25:54 -0500359
Greg Daniel94403452017-04-18 15:52:36 -0400360private:
Greg Daniel5254ccc2017-11-13 11:05:52 -0500361 // Friending for access to the GrPixelConfig
362 friend class SkSurface;
Greg Danielfaa095e2017-12-19 13:15:02 -0500363 friend class SkSurface_Gpu;
364 friend class SkImage_Gpu;
Greg Daniel5254ccc2017-11-13 11:05:52 -0500365 friend class GrGpu;
366 friend class GrGLGpu;
Greg Daniel2a303902018-02-20 10:25:54 -0500367 friend class GrProxyProvider;
Greg Daniel5254ccc2017-11-13 11:05:52 -0500368 friend class GrVkGpu;
Timothy Liang4e85e802018-06-28 16:37:18 -0400369 friend class GrMtlGpu;
Greg Daniel5254ccc2017-11-13 11:05:52 -0500370 GrPixelConfig config() const { return fConfig; }
371
Greg Daniel323fbcf2018-04-10 13:46:30 -0400372 // Requires friending of GrVkGpu (done above already)
373 sk_sp<GrVkImageLayout> getGrVkImageLayout() const;
374
375 friend class GrVkRenderTarget;
376 GrBackendRenderTarget(int width, int height, int sampleCnt, const GrVkImageInfo& vkInfo,
377 sk_sp<GrVkImageLayout> layout);
Greg Daniel323fbcf2018-04-10 13:46:30 -0400378
379 // Free and release and resources being held by the GrBackendTexture.
380 void cleanup();
381
Greg Daniel9ca30652018-04-06 09:27:20 -0400382 bool fIsValid;
Greg Daniel94403452017-04-18 15:52:36 -0400383 int fWidth; //<! width in pixels
384 int fHeight; //<! height in pixels
385
386 int fSampleCnt;
387 int fStencilBits;
388 GrPixelConfig fConfig;
Jim Van Verth7730d7c2019-05-28 03:03:45 +0000389
Greg Danielbdf12ad2018-10-12 09:31:11 -0400390 GrBackendApi fBackend;
Greg Daniel94403452017-04-18 15:52:36 -0400391
392 union {
Robert Phillipsfad9e3f2017-06-13 22:16:08 +0000393 GrGLFramebufferInfo fGLInfo;
Greg Daniel323fbcf2018-04-10 13:46:30 -0400394 GrVkBackendSurfaceInfo fVkInfo;
Brian Salomon0c51eea2018-03-09 17:02:09 -0500395 GrMockRenderTargetInfo fMockInfo;
Greg Daniel94403452017-04-18 15:52:36 -0400396 };
Jim Van Verthdac1e552019-05-31 09:10:55 -0400397#ifdef SK_METAL
398 GrMtlTextureInfo fMtlInfo;
399#endif
Greg Daniel94403452017-04-18 15:52:36 -0400400};
401
402#endif
403
Robert Phillips8caf85f2018-04-05 09:30:38 -0400404#endif
405