bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 GrResourceProvider_DEFINED |
| 9 | #define GrResourceProvider_DEFINED |
| 10 | |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 11 | #include "GrBuffer.h" |
Greg Daniel | 77b53f6 | 2016-10-18 11:48:51 -0400 | [diff] [blame] | 12 | #include "GrGpu.h" |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 13 | #include "GrPathRange.h" |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 14 | |
Greg Daniel | bcf612b | 2017-05-01 13:50:58 +0000 | [diff] [blame] | 15 | class GrBackendRenderTarget; |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 16 | class GrPath; |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 17 | class GrRenderTarget; |
joshualitt | 6d0872d | 2016-01-11 08:27:48 -0800 | [diff] [blame] | 18 | class GrSingleOwner; |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 19 | class GrStencilAttachment; |
bsalomon | 6663acf | 2016-05-10 09:14:17 -0700 | [diff] [blame] | 20 | class GrStyle; |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 21 | class SkDescriptor; |
| 22 | class SkPath; |
| 23 | class SkTypeface; |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 24 | |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 25 | /** |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 26 | * A factory for arbitrary resource types. This class is intended for use within the Gr code base. |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 27 | * |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 28 | * Some members force callers to make a flags (pendingIO) decision. This can be relaxed once |
| 29 | * https://bug.skia.org/4156 is fixed. |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 30 | */ |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 31 | class GrResourceProvider { |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 32 | public: |
joshualitt | 6d0872d | 2016-01-11 08:27:48 -0800 | [diff] [blame] | 33 | GrResourceProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* owner); |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 34 | |
| 35 | template <typename T> T* findAndRefTByUniqueKey(const GrUniqueKey& key) { |
| 36 | return static_cast<T*>(this->findAndRefResourceByUniqueKey(key)); |
| 37 | } |
| 38 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 39 | /////////////////////////////////////////////////////////////////////////// |
| 40 | // Textures |
| 41 | |
| 42 | /** |
| 43 | * Creates a new texture in the resource cache and returns it. The caller owns a |
| 44 | * ref on the returned texture which must be balanced by a call to unref. |
| 45 | * |
| 46 | * @param desc Description of the texture properties. |
| 47 | * @param budgeted Does the texture count against the resource cache budget? |
| 48 | * @param texels A contiguous array of mipmap levels |
| 49 | * @param mipLevelCount The amount of elements in the texels array |
| 50 | */ |
Robert Phillips | e78b725 | 2017-04-06 07:59:41 -0400 | [diff] [blame] | 51 | sk_sp<GrTextureProxy> createMipMappedTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
| 52 | const GrMipLevel* texels, int mipLevelCount, |
Robert Phillips | e78b725 | 2017-04-06 07:59:41 -0400 | [diff] [blame] | 53 | SkDestinationSurfaceColorMode mipColorMode = |
Robert Phillips | a4c41b3 | 2017-03-15 13:02:45 -0400 | [diff] [blame] | 54 | SkDestinationSurfaceColorMode::kLegacy); |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 55 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 56 | /** Assigns a unique key to the texture. The texture will be findable via this key using |
| 57 | findTextureByUniqueKey(). If an existing texture has this key, it's key will be removed. */ |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 58 | void assignUniqueKeyToProxy(const GrUniqueKey& key, GrTextureProxy*); |
| 59 | |
Robert Phillips | 3798c86 | 2017-03-27 11:08:16 -0400 | [diff] [blame] | 60 | /** Finds a texture by unique key. If the texture is found it is ref'ed and returned. */ |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 61 | sk_sp<GrTextureProxy> findProxyByUniqueKey(const GrUniqueKey& key); |
| 62 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 63 | /** |
| 64 | * Finds a texture that approximately matches the descriptor. Will be at least as large in width |
| 65 | * and height as desc specifies. If desc specifies that the texture should be a render target |
| 66 | * then result will be a render target. Format and sample count will always match the request. |
| 67 | * The contents of the texture are undefined. The caller owns a ref on the returned texture and |
| 68 | * must balance with a call to unref. |
| 69 | */ |
| 70 | GrTexture* createApproxTexture(const GrSurfaceDesc&, uint32_t flags); |
| 71 | |
Robert Phillips | e78b725 | 2017-04-06 07:59:41 -0400 | [diff] [blame] | 72 | /** Create an exact fit texture with no initial data to upload. |
| 73 | */ |
Robert Phillips | 45fdae1 | 2017-04-17 12:57:27 -0400 | [diff] [blame] | 74 | sk_sp<GrTexture> createTexture(const GrSurfaceDesc&, SkBudgeted, uint32_t flags = 0); |
| 75 | |
| 76 | sk_sp<GrTextureProxy> createTextureProxy(const GrSurfaceDesc&, SkBudgeted, const GrMipLevel&); |
Robert Phillips | e78b725 | 2017-04-06 07:59:41 -0400 | [diff] [blame] | 77 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 78 | /////////////////////////////////////////////////////////////////////////// |
| 79 | // Wrapped Backend Surfaces |
| 80 | |
| 81 | /** |
| 82 | * Wraps an existing texture with a GrTexture object. |
| 83 | * |
| 84 | * OpenGL: if the object is a texture Gr may change its GL texture params |
| 85 | * when it is drawn. |
| 86 | * |
| 87 | * @return GrTexture object or NULL on failure. |
| 88 | */ |
Greg Daniel | 7ef28f3 | 2017-04-20 16:41:55 +0000 | [diff] [blame] | 89 | sk_sp<GrTexture> wrapBackendTexture(const GrBackendTexture& tex, |
| 90 | GrSurfaceOrigin origin, |
| 91 | GrBackendTextureFlags flags, |
| 92 | int sampleCnt, |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 93 | GrWrapOwnership = kBorrow_GrWrapOwnership); |
| 94 | |
| 95 | /** |
| 96 | * Wraps an existing render target with a GrRenderTarget object. It is |
| 97 | * similar to wrapBackendTexture but can be used to draw into surfaces |
| 98 | * that are not also textures (e.g. FBO 0 in OpenGL, or an MSAA buffer that |
| 99 | * the client will resolve to a texture). Currently wrapped render targets |
| 100 | * always use the kBorrow_GrWrapOwnership semantics. |
| 101 | * |
| 102 | * @return GrRenderTarget object or NULL on failure. |
| 103 | */ |
Greg Daniel | bcf612b | 2017-05-01 13:50:58 +0000 | [diff] [blame] | 104 | sk_sp<GrRenderTarget> wrapBackendRenderTarget(const GrBackendRenderTarget&, GrSurfaceOrigin); |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 105 | |
| 106 | static const int kMinScratchTextureSize; |
| 107 | |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 108 | /** |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 109 | * Either finds and refs, or creates an index buffer with a repeating pattern for drawing |
| 110 | * contiguous vertices of a repeated mesh. If the return is non-null, the caller owns a ref on |
| 111 | * the returned GrBuffer. |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 112 | * |
| 113 | * @param pattern the pattern of indices to repeat |
| 114 | * @param patternSize size in bytes of the pattern |
| 115 | * @param reps number of times to repeat the pattern |
| 116 | * @param vertCount number of vertices the pattern references |
| 117 | * @param key Key to be assigned to the index buffer. |
| 118 | * |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 119 | * @return The index buffer if successful, otherwise nullptr. |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 120 | */ |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 121 | const GrBuffer* findOrCreatePatternedIndexBuffer(const uint16_t* pattern, |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 122 | int patternSize, |
| 123 | int reps, |
| 124 | int vertCount, |
| 125 | const GrUniqueKey& key) { |
| 126 | if (GrBuffer* buffer = this->findAndRefTByUniqueKey<GrBuffer>(key)) { |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 127 | return buffer; |
| 128 | } |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 129 | return this->createPatternedIndexBuffer(pattern, patternSize, reps, vertCount, key); |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | /** |
| 133 | * Returns an index buffer that can be used to render quads. |
| 134 | * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 135 | * The max number of quads is the buffer's index capacity divided by 6. |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 136 | * Draw with kTriangles_GrPrimitiveType |
| 137 | * @ return the quad index buffer |
| 138 | */ |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 139 | const GrBuffer* refQuadIndexBuffer() { |
| 140 | if (GrBuffer* buffer = |
| 141 | this->findAndRefTByUniqueKey<GrBuffer>(fQuadIndexBufferKey)) { |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 142 | return buffer; |
| 143 | } |
| 144 | return this->createQuadIndexBuffer(); |
| 145 | } |
| 146 | |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 147 | /** |
| 148 | * Factories for GrPath and GrPathRange objects. It's an error to call these if path rendering |
| 149 | * is not supported. |
| 150 | */ |
bsalomon | 6663acf | 2016-05-10 09:14:17 -0700 | [diff] [blame] | 151 | GrPath* createPath(const SkPath&, const GrStyle&); |
| 152 | GrPathRange* createPathRange(GrPathRange::PathGenerator*, const GrStyle&); |
reed | a9322c2 | 2016-04-12 06:47:05 -0700 | [diff] [blame] | 153 | GrPathRange* createGlyphs(const SkTypeface*, const SkScalerContextEffects&, |
bsalomon | 6663acf | 2016-05-10 09:14:17 -0700 | [diff] [blame] | 154 | const SkDescriptor*, const GrStyle&); |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 155 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 156 | /** These flags govern which scratch resources we are allowed to return */ |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 157 | enum Flags { |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 158 | kExact_Flag = 0x1, |
| 159 | |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 160 | /** If the caller intends to do direct reads/writes to/from the CPU then this flag must be |
Robert Phillips | f2361d2 | 2016-10-25 14:20:06 -0400 | [diff] [blame] | 161 | * set when accessing resources during a GrOpList flush. This includes the execution of |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 162 | * GrOp objects. The reason is that these memory operations are done immediately and |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 163 | * will occur out of order WRT the operations being flushed. |
halcanary | 6950de6 | 2015-11-07 05:29:00 -0800 | [diff] [blame] | 164 | * Make this automatic: https://bug.skia.org/4156 |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 165 | */ |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 166 | kNoPendingIO_Flag = 0x2, |
| 167 | |
| 168 | kNoCreate_Flag = 0x4, |
csmartdalton | 485a120 | 2016-07-13 10:16:32 -0700 | [diff] [blame] | 169 | |
| 170 | /** Normally the caps may indicate a preference for client-side buffers. Set this flag when |
| 171 | * creating a buffer to guarantee it resides in GPU memory. |
| 172 | */ |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 173 | kRequireGpuMemory_Flag = 0x8, |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 174 | }; |
| 175 | |
cdalton | e2e71c2 | 2016-04-07 18:13:29 -0700 | [diff] [blame] | 176 | /** |
| 177 | * Returns a buffer. |
| 178 | * |
| 179 | * @param size minimum size of buffer to return. |
| 180 | * @param intendedType hint to the graphics subsystem about what the buffer will be used for. |
| 181 | * @param GrAccessPattern hint to the graphics subsystem about how the data will be accessed. |
| 182 | * @param flags see Flags enum. |
cdalton | 1bf3e71 | 2016-04-19 10:00:02 -0700 | [diff] [blame] | 183 | * @param data optional data with which to initialize the buffer. |
cdalton | e2e71c2 | 2016-04-07 18:13:29 -0700 | [diff] [blame] | 184 | * |
| 185 | * @return the buffer if successful, otherwise nullptr. |
| 186 | */ |
cdalton | 1bf3e71 | 2016-04-19 10:00:02 -0700 | [diff] [blame] | 187 | GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPattern, uint32_t flags, |
| 188 | const void* data = nullptr); |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 189 | |
robertphillips | 1b8e1b5 | 2015-06-24 06:54:10 -0700 | [diff] [blame] | 190 | |
Brian Salomon | 2ee084e | 2016-12-16 18:59:19 -0500 | [diff] [blame] | 191 | /** |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 192 | * If passed in render target already has a stencil buffer, return it. Otherwise attempt to |
| 193 | * attach one. |
| 194 | */ |
| 195 | GrStencilAttachment* attachStencilAttachment(GrRenderTarget* rt); |
| 196 | |
ericrk | f7b8b8a | 2016-02-24 14:49:51 -0800 | [diff] [blame] | 197 | /** |
| 198 | * Wraps an existing texture with a GrRenderTarget object. This is useful when the provided |
| 199 | * texture has a format that cannot be textured from by Skia, but we want to raster to it. |
| 200 | * |
kkinnunen | 49c4c22 | 2016-04-01 04:50:37 -0700 | [diff] [blame] | 201 | * The texture is wrapped as borrowed. The texture object will not be freed once the |
| 202 | * render target is destroyed. |
| 203 | * |
ericrk | f7b8b8a | 2016-02-24 14:49:51 -0800 | [diff] [blame] | 204 | * @return GrRenderTarget object or NULL on failure. |
| 205 | */ |
Greg Daniel | 7ef28f3 | 2017-04-20 16:41:55 +0000 | [diff] [blame] | 206 | sk_sp<GrRenderTarget> wrapBackendTextureAsRenderTarget(const GrBackendTexture&, |
| 207 | GrSurfaceOrigin origin, |
| 208 | int sampleCnt); |
ericrk | f7b8b8a | 2016-02-24 14:49:51 -0800 | [diff] [blame] | 209 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 210 | /** |
| 211 | * Assigns a unique key to a resource. If the key is associated with another resource that |
| 212 | * association is removed and replaced by this resource. |
| 213 | */ |
| 214 | void assignUniqueKeyToResource(const GrUniqueKey&, GrGpuResource*); |
| 215 | |
| 216 | /** |
| 217 | * Finds a resource in the cache, based on the specified key. This is intended for use in |
| 218 | * conjunction with addResourceToCache(). The return value will be NULL if not found. The |
| 219 | * caller must balance with a call to unref(). |
| 220 | */ |
| 221 | GrGpuResource* findAndRefResourceByUniqueKey(const GrUniqueKey&); |
| 222 | |
Greg Daniel | d85f97d | 2017-03-07 13:37:21 -0500 | [diff] [blame] | 223 | sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT makeSemaphore(); |
| 224 | |
| 225 | // Takes the GrSemaphore and sets the ownership of the semaphore to the GrGpu object used by |
| 226 | // this class. This call is only used when passing a GrSemaphore from one context to another. |
| 227 | void takeOwnershipOfSemaphore(sk_sp<GrSemaphore>); |
| 228 | // Takes the GrSemaphore and resets the ownership of the semaphore so that it is not owned by |
| 229 | // any GrGpu. A follow up call to takeOwnershipofSemaphore must be made so that the underlying |
| 230 | // semaphore can be deleted. This call is only used when passing a GrSemaphore from one context |
| 231 | // to another. |
| 232 | void releaseOwnershipOfSemaphore(sk_sp<GrSemaphore>); |
| 233 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 234 | void abandon() { |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 235 | fCache = nullptr; |
| 236 | fGpu = nullptr; |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 237 | } |
| 238 | |
Robert Phillips | f7a7261 | 2017-03-31 10:03:45 -0400 | [diff] [blame] | 239 | // 'proxy' is about to be used as a texture src or drawn to. This query can be used to |
| 240 | // determine if it is going to need a texture domain or a full clear. |
| 241 | static bool IsFunctionallyExact(GrSurfaceProxy* proxy); |
Robert Phillips | b66b42f | 2017-03-14 08:53:02 -0400 | [diff] [blame] | 242 | |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 243 | const GrCaps* caps() const { return fCaps.get(); } |
| 244 | |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 245 | private: |
Robert Phillips | 3798c86 | 2017-03-27 11:08:16 -0400 | [diff] [blame] | 246 | GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key); |
| 247 | void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) { |
| 248 | SkASSERT(key.isValid()); |
| 249 | this->assignUniqueKeyToResource(key, texture); |
| 250 | } |
| 251 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 252 | GrTexture* refScratchTexture(const GrSurfaceDesc&, uint32_t scratchTextureFlags); |
| 253 | |
Robert Phillips | 45fdae1 | 2017-04-17 12:57:27 -0400 | [diff] [blame] | 254 | /* |
| 255 | * Try to find an existing scratch texture that exactly matches 'desc'. If successful |
| 256 | * update the budgeting accordingly. |
| 257 | */ |
| 258 | sk_sp<GrTexture> getExactScratch(const GrSurfaceDesc&, SkBudgeted, uint32_t flags); |
| 259 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 260 | GrResourceCache* cache() { return fCache; } |
| 261 | const GrResourceCache* cache() const { return fCache; } |
| 262 | |
| 263 | GrGpu* gpu() { return fGpu; } |
| 264 | const GrGpu* gpu() const { return fGpu; } |
| 265 | |
| 266 | bool isAbandoned() const { |
| 267 | SkASSERT(SkToBool(fGpu) == SkToBool(fCache)); |
| 268 | return !SkToBool(fCache); |
| 269 | } |
| 270 | |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 271 | const GrBuffer* createPatternedIndexBuffer(const uint16_t* pattern, |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 272 | int patternSize, |
| 273 | int reps, |
| 274 | int vertCount, |
| 275 | const GrUniqueKey& key); |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 276 | |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 277 | const GrBuffer* createQuadIndexBuffer(); |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 278 | |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 279 | GrResourceCache* fCache; |
| 280 | GrGpu* fGpu; |
| 281 | sk_sp<const GrCaps> fCaps; |
| 282 | GrUniqueKey fQuadIndexBufferKey; |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 283 | |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 284 | // In debug builds we guard against improper thread handling |
| 285 | SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 286 | }; |
| 287 | |
| 288 | #endif |