Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 GrProxyProvider_DEFINED |
| 9 | #define GrProxyProvider_DEFINED |
| 10 | |
Robert Phillips | c4039ea | 2018-03-01 11:36:45 -0500 | [diff] [blame] | 11 | #include "GrCaps.h" |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 12 | #include "GrResourceKey.h" |
| 13 | #include "GrTextureProxy.h" |
| 14 | #include "GrTypes.h" |
| 15 | #include "SkRefCnt.h" |
| 16 | #include "SkTDynamicHash.h" |
| 17 | |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 18 | class GrResourceProvider; |
| 19 | class GrSingleOwner; |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 20 | class GrBackendRenderTarget; |
Greg Daniel | a4ead65 | 2018-02-07 10:21:48 -0500 | [diff] [blame] | 21 | class SkBitmap; |
Greg Daniel | 9d86f1d | 2018-01-29 09:33:59 -0500 | [diff] [blame] | 22 | class SkImage; |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 23 | |
| 24 | /* |
| 25 | * A factory for creating GrSurfaceProxy-derived objects. |
| 26 | */ |
| 27 | class GrProxyProvider { |
| 28 | public: |
| 29 | GrProxyProvider(GrResourceProvider*, GrResourceCache*, sk_sp<const GrCaps>, GrSingleOwner*); |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 30 | GrProxyProvider(uint32_t contextUniqueID, sk_sp<const GrCaps>, GrSingleOwner*); |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 31 | |
| 32 | ~GrProxyProvider(); |
| 33 | |
| 34 | /* |
| 35 | * Assigns a unique key to a proxy. The proxy will be findable via this key using |
| 36 | * findProxyByUniqueKey(). It is an error if an existing proxy already has a key. |
| 37 | */ |
Robert Phillips | adbe132 | 2018-01-17 13:35:46 -0500 | [diff] [blame] | 38 | bool assignUniqueKeyToProxy(const GrUniqueKey&, GrTextureProxy*); |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 39 | |
| 40 | /* |
| 41 | * Sets the unique key of the provided proxy to the unique key of the surface. The surface must |
| 42 | * have a valid unique key. |
| 43 | */ |
| 44 | void adoptUniqueKeyFromSurface(GrTextureProxy* proxy, const GrSurface*); |
| 45 | |
| 46 | /* |
| 47 | * Removes a unique key from a proxy. If the proxy has already been instantiated, it will |
| 48 | * also remove the unique key from the target GrSurface. |
| 49 | */ |
Chris Dalton | 2de13dd | 2019-01-03 15:11:59 -0700 | [diff] [blame] | 50 | void removeUniqueKeyFromProxy(GrTextureProxy*); |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 51 | |
| 52 | /* |
| 53 | * Finds a proxy by unique key. |
| 54 | */ |
| 55 | sk_sp<GrTextureProxy> findProxyByUniqueKey(const GrUniqueKey&, GrSurfaceOrigin); |
| 56 | |
| 57 | /* |
| 58 | * Finds a proxy by unique key or creates a new one that wraps a resource matching the unique |
| 59 | * key. |
| 60 | */ |
| 61 | sk_sp<GrTextureProxy> findOrCreateProxyByUniqueKey(const GrUniqueKey&, GrSurfaceOrigin); |
| 62 | |
| 63 | /* |
Greg Daniel | 9d86f1d | 2018-01-29 09:33:59 -0500 | [diff] [blame] | 64 | * Create an un-mipmapped texture proxy with data. The SkImage must be a raster backend image. |
| 65 | * Since the SkImage is ref counted, we simply take a ref on it to keep the data alive until we |
| 66 | * actually upload the data to the gpu. |
| 67 | */ |
Chris Dalton | d004e0b | 2018-09-27 09:28:03 -0600 | [diff] [blame] | 68 | sk_sp<GrTextureProxy> createTextureProxy( |
| 69 | sk_sp<SkImage> srcImage, GrSurfaceDescFlags, int sampleCnt, SkBudgeted, SkBackingFit, |
| 70 | GrInternalSurfaceFlags = GrInternalSurfaceFlags::kNone); |
Greg Daniel | 9d86f1d | 2018-01-29 09:33:59 -0500 | [diff] [blame] | 71 | |
| 72 | /* |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 73 | * Create a mipmapped texture proxy without any data. |
| 74 | * |
| 75 | * Like the call above but there are no texels to upload. A texture proxy is returned that |
| 76 | * simply has space allocated for the mips. We will allocated the full amount of mip levels |
| 77 | * based on the width and height in the GrSurfaceDesc. |
| 78 | */ |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 79 | sk_sp<GrTextureProxy> createMipMapProxy(const GrBackendFormat&, const GrSurfaceDesc&, |
| 80 | GrSurfaceOrigin, SkBudgeted); |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 81 | |
| 82 | /* |
Greg Daniel | a4ead65 | 2018-02-07 10:21:48 -0500 | [diff] [blame] | 83 | * Creates a new mipmapped texture proxy for the bitmap with mip levels generated by the cpu. |
| 84 | */ |
Brian Osman | 2b23c4b | 2018-06-01 12:25:08 -0400 | [diff] [blame] | 85 | sk_sp<GrTextureProxy> createMipMapProxyFromBitmap(const SkBitmap& bitmap); |
Greg Daniel | a4ead65 | 2018-02-07 10:21:48 -0500 | [diff] [blame] | 86 | |
| 87 | /* |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 88 | * Create a GrSurfaceProxy without any data. |
| 89 | */ |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 90 | sk_sp<GrTextureProxy> createProxy(const GrBackendFormat&, const GrSurfaceDesc&, GrSurfaceOrigin, |
| 91 | GrMipMapped, SkBackingFit, SkBudgeted, |
| 92 | GrInternalSurfaceFlags); |
Greg Daniel | f6f7b67 | 2018-02-15 13:06:26 -0500 | [diff] [blame] | 93 | |
Robert Phillips | fe0253f | 2018-03-16 16:47:25 -0400 | [diff] [blame] | 94 | sk_sp<GrTextureProxy> createProxy( |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 95 | const GrBackendFormat& format, const GrSurfaceDesc& desc, |
| 96 | GrSurfaceOrigin origin, SkBackingFit fit, SkBudgeted budgeted, |
Robert Phillips | fe0253f | 2018-03-16 16:47:25 -0400 | [diff] [blame] | 97 | GrInternalSurfaceFlags surfaceFlags = GrInternalSurfaceFlags::kNone) { |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 98 | return this->createProxy(format, desc, origin, GrMipMapped::kNo, fit, budgeted, |
| 99 | surfaceFlags); |
Greg Daniel | f6f7b67 | 2018-02-15 13:06:26 -0500 | [diff] [blame] | 100 | } |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 101 | |
Robert Phillips | adbe132 | 2018-01-17 13:35:46 -0500 | [diff] [blame] | 102 | // These match the definitions in SkImage & GrTexture.h, for whence they came |
| 103 | typedef void* ReleaseContext; |
| 104 | typedef void (*ReleaseProc)(ReleaseContext); |
| 105 | |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 106 | /* |
Brian Salomon | c67c31c | 2018-12-06 10:00:03 -0500 | [diff] [blame] | 107 | * Create a texture proxy that wraps a (non-renderable) backend texture. GrIOType must be |
| 108 | * kRead or kRW. |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 109 | */ |
Brian Salomon | 7578f3e | 2018-03-07 14:39:54 -0500 | [diff] [blame] | 110 | sk_sp<GrTextureProxy> wrapBackendTexture(const GrBackendTexture&, GrSurfaceOrigin, |
Brian Salomon | c67c31c | 2018-12-06 10:00:03 -0500 | [diff] [blame] | 111 | GrWrapOwnership, GrIOType, ReleaseProc = nullptr, |
| 112 | ReleaseContext = nullptr); |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 113 | |
| 114 | /* |
| 115 | * Create a texture proxy that wraps a backend texture and is both texture-able and renderable |
| 116 | */ |
Brian Salomon | 7578f3e | 2018-03-07 14:39:54 -0500 | [diff] [blame] | 117 | sk_sp<GrTextureProxy> wrapRenderableBackendTexture(const GrBackendTexture&, |
| 118 | GrSurfaceOrigin, |
Brian Salomon | 02bd295 | 2018-03-07 15:20:21 -0500 | [diff] [blame] | 119 | int sampleCnt, |
| 120 | GrWrapOwnership = kBorrow_GrWrapOwnership); |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 121 | |
| 122 | /* |
Brian Salomon | c67c31c | 2018-12-06 10:00:03 -0500 | [diff] [blame] | 123 | * Create a render target proxy that wraps a backend render target |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 124 | */ |
Brian Salomon | 7578f3e | 2018-03-07 14:39:54 -0500 | [diff] [blame] | 125 | sk_sp<GrSurfaceProxy> wrapBackendRenderTarget(const GrBackendRenderTarget&, GrSurfaceOrigin); |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 126 | |
| 127 | /* |
Brian Salomon | 7578f3e | 2018-03-07 14:39:54 -0500 | [diff] [blame] | 128 | * Create a render target proxy that wraps a backend texture |
Robert Phillips | 0bd24dc | 2018-01-16 08:06:32 -0500 | [diff] [blame] | 129 | */ |
Kevin Lubick | b5502b2 | 2018-03-12 10:17:06 -0400 | [diff] [blame] | 130 | sk_sp<GrSurfaceProxy> wrapBackendTextureAsRenderTarget(const GrBackendTexture& backendTex, |
Brian Salomon | 7578f3e | 2018-03-07 14:39:54 -0500 | [diff] [blame] | 131 | GrSurfaceOrigin origin, |
| 132 | int sampleCnt); |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 133 | |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 134 | sk_sp<GrRenderTargetProxy> wrapVulkanSecondaryCBAsRenderTarget(const SkImageInfo&, |
| 135 | const GrVkDrawableInfo&); |
| 136 | |
Robert Phillips | ce5209a | 2018-02-13 11:13:51 -0500 | [diff] [blame] | 137 | using LazyInstantiateCallback = std::function<sk_sp<GrSurface>(GrResourceProvider*)>; |
Robert Phillips | e8fabb2 | 2018-02-04 14:33:21 -0500 | [diff] [blame] | 138 | |
Robert Phillips | 777707b | 2018-01-17 11:40:14 -0500 | [diff] [blame] | 139 | enum class Renderable : bool { |
| 140 | kNo = false, |
| 141 | kYes = true |
| 142 | }; |
| 143 | |
Brian Salomon | 7226c23 | 2018-07-30 13:13:17 -0400 | [diff] [blame] | 144 | struct TextureInfo { |
| 145 | GrMipMapped fMipMapped; |
| 146 | GrTextureType fTextureType; |
| 147 | }; |
| 148 | |
Greg Daniel | a8d9211 | 2018-03-09 12:05:04 -0500 | [diff] [blame] | 149 | using LazyInstantiationType = GrSurfaceProxy::LazyInstantiationType; |
Robert Phillips | 777707b | 2018-01-17 11:40:14 -0500 | [diff] [blame] | 150 | /** |
| 151 | * Creates a texture proxy that will be instantiated by a user-supplied callback during flush. |
| 152 | * (Stencil is not supported by this method.) The width and height must either both be greater |
| 153 | * than 0 or both less than or equal to zero. A non-positive value is a signal that the width |
| 154 | * and height are currently unknown. |
| 155 | * |
| 156 | * When called, the callback must be able to cleanup any resources that it captured at creation. |
| 157 | * It also must support being passed in a null GrResourceProvider. When this happens, the |
| 158 | * callback should cleanup any resources it captured and return an empty sk_sp<GrTextureProxy>. |
| 159 | */ |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 160 | sk_sp<GrTextureProxy> createLazyProxy(LazyInstantiateCallback&&, const GrBackendFormat&, |
| 161 | const GrSurfaceDesc&, GrSurfaceOrigin, GrMipMapped, |
Brian Salomon | 7226c23 | 2018-07-30 13:13:17 -0400 | [diff] [blame] | 162 | GrInternalSurfaceFlags, SkBackingFit, SkBudgeted, |
| 163 | LazyInstantiationType); |
Greg Daniel | a8d9211 | 2018-03-09 12:05:04 -0500 | [diff] [blame] | 164 | |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 165 | sk_sp<GrTextureProxy> createLazyProxy(LazyInstantiateCallback&&, const GrBackendFormat&, |
| 166 | const GrSurfaceDesc&, GrSurfaceOrigin, GrMipMapped, |
Brian Salomon | 7226c23 | 2018-07-30 13:13:17 -0400 | [diff] [blame] | 167 | GrInternalSurfaceFlags, SkBackingFit, SkBudgeted); |
Greg Daniel | 2a30390 | 2018-02-20 10:25:54 -0500 | [diff] [blame] | 168 | |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 169 | sk_sp<GrTextureProxy> createLazyProxy(LazyInstantiateCallback&&, const GrBackendFormat&, |
| 170 | const GrSurfaceDesc&, GrSurfaceOrigin, GrMipMapped, |
| 171 | SkBackingFit, SkBudgeted); |
Brian Salomon | 7226c23 | 2018-07-30 13:13:17 -0400 | [diff] [blame] | 172 | |
| 173 | /** A null TextureInfo indicates a non-textureable render target. */ |
Robert Phillips | e8fabb2 | 2018-02-04 14:33:21 -0500 | [diff] [blame] | 174 | sk_sp<GrRenderTargetProxy> createLazyRenderTargetProxy(LazyInstantiateCallback&&, |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 175 | const GrBackendFormat&, |
Greg Daniel | 2a30390 | 2018-02-20 10:25:54 -0500 | [diff] [blame] | 176 | const GrSurfaceDesc&, |
Brian Salomon | 2a4f983 | 2018-03-03 22:43:43 -0500 | [diff] [blame] | 177 | GrSurfaceOrigin origin, |
Brian Salomon | 7226c23 | 2018-07-30 13:13:17 -0400 | [diff] [blame] | 178 | GrInternalSurfaceFlags, |
| 179 | const TextureInfo*, |
| 180 | SkBackingFit, |
| 181 | SkBudgeted); |
Robert Phillips | e8fabb2 | 2018-02-04 14:33:21 -0500 | [diff] [blame] | 182 | |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 183 | /** |
| 184 | * Fully lazy proxies have unspecified width and height. Methods that rely on those values |
| 185 | * (e.g., width, height, getBoundsRect) should be avoided. |
| 186 | */ |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 187 | static sk_sp<GrTextureProxy> MakeFullyLazyProxy(LazyInstantiateCallback&&, |
| 188 | const GrBackendFormat&, Renderable, |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 189 | GrSurfaceOrigin, GrPixelConfig, const GrCaps&); |
| 190 | |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 191 | // 'proxy' is about to be used as a texture src or drawn to. This query can be used to |
| 192 | // determine if it is going to need a texture domain or a full clear. |
| 193 | static bool IsFunctionallyExact(GrSurfaceProxy* proxy); |
| 194 | |
Robert Phillips | 427966a | 2018-12-20 17:20:43 -0500 | [diff] [blame] | 195 | enum class InvalidateGPUResource : bool { kNo = false, kYes = true }; |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 196 | |
Robert Phillips | 427966a | 2018-12-20 17:20:43 -0500 | [diff] [blame] | 197 | /* |
| 198 | * This method ensures that, if a proxy w/ the supplied unique key exists, it is removed from |
| 199 | * the proxy provider's map and its unique key is removed. If 'invalidateSurface' is true, it |
| 200 | * will independently ensure that the unique key is removed from any GrGpuResources that may |
| 201 | * have it. |
| 202 | * |
| 203 | * If 'proxy' is provided (as an optimization to stop re-looking it up), its unique key must be |
| 204 | * valid and match the provided unique key. |
| 205 | * |
| 206 | * This method is called if either the proxy attached to the unique key is being deleted |
| 207 | * (in which case we don't want it cluttering up the hash table) or the client has indicated |
| 208 | * that it will never refer to the unique key again. |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 209 | */ |
Chris Dalton | 2de13dd | 2019-01-03 15:11:59 -0700 | [diff] [blame] | 210 | void processInvalidUniqueKey(const GrUniqueKey&, GrTextureProxy*, InvalidateGPUResource); |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 211 | |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 212 | uint32_t contextUniqueID() const { return fContextUniqueID; } |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 213 | const GrCaps* caps() const { return fCaps.get(); } |
Robert Phillips | c4039ea | 2018-03-01 11:36:45 -0500 | [diff] [blame] | 214 | sk_sp<const GrCaps> refCaps() const { return fCaps; } |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 215 | |
| 216 | void abandon() { |
| 217 | fResourceCache = nullptr; |
| 218 | fResourceProvider = nullptr; |
Robert Phillips | 4d12051 | 2018-01-19 13:22:07 -0500 | [diff] [blame] | 219 | fAbandoned = true; |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | bool isAbandoned() const { |
Robert Phillips | 4d12051 | 2018-01-19 13:22:07 -0500 | [diff] [blame] | 223 | #ifdef SK_DEBUG |
| 224 | if (fAbandoned) { |
| 225 | SkASSERT(!fResourceCache && !fResourceProvider); |
| 226 | } |
| 227 | #endif |
| 228 | return fAbandoned; |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | int numUniqueKeyProxies_TestOnly() const; |
| 232 | |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 233 | // This is called on a DDL's proxyprovider when the DDL is finished. The uniquely keyed |
| 234 | // proxies need to keep their unique key but cannot hold on to the proxy provider unique |
| 235 | // pointer. |
| 236 | void orphanAllUniqueKeys(); |
| 237 | // This is only used by GrContext::releaseResourcesAndAbandonContext() |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 238 | void removeAllUniqueKeys(); |
| 239 | |
Greg Daniel | 7e1912a | 2018-02-08 09:15:33 -0500 | [diff] [blame] | 240 | /** |
Robert Phillips | 5c4b33b | 2018-03-20 16:23:08 -0400 | [diff] [blame] | 241 | * Are we currently recording a DDL? |
Greg Daniel | 7e1912a | 2018-02-08 09:15:33 -0500 | [diff] [blame] | 242 | */ |
Robert Phillips | 5c4b33b | 2018-03-20 16:23:08 -0400 | [diff] [blame] | 243 | bool recordingDDL() const { return !SkToBool(fResourceProvider); } |
Greg Daniel | 7e1912a | 2018-02-08 09:15:33 -0500 | [diff] [blame] | 244 | |
Chris Dalton | d004e0b | 2018-09-27 09:28:03 -0600 | [diff] [blame] | 245 | /* |
| 246 | * Create a texture proxy that is backed by an instantiated GrSurface. |
| 247 | */ |
| 248 | sk_sp<GrTextureProxy> testingOnly_createInstantiatedProxy(const GrSurfaceDesc&, GrSurfaceOrigin, |
| 249 | SkBackingFit, SkBudgeted); |
| 250 | |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 251 | private: |
Robert Phillips | adbe132 | 2018-01-17 13:35:46 -0500 | [diff] [blame] | 252 | friend class GrAHardwareBufferImageGenerator; // for createWrapped |
Chris Dalton | d004e0b | 2018-09-27 09:28:03 -0600 | [diff] [blame] | 253 | friend class GrResourceProvider; // for createWrapped |
Robert Phillips | adbe132 | 2018-01-17 13:35:46 -0500 | [diff] [blame] | 254 | |
| 255 | sk_sp<GrTextureProxy> createWrapped(sk_sp<GrTexture> tex, GrSurfaceOrigin origin); |
| 256 | |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 257 | struct UniquelyKeyedProxyHashTraits { |
| 258 | static const GrUniqueKey& GetKey(const GrTextureProxy& p) { return p.getUniqueKey(); } |
| 259 | |
| 260 | static uint32_t Hash(const GrUniqueKey& key) { return key.hash(); } |
| 261 | }; |
| 262 | typedef SkTDynamicHash<GrTextureProxy, GrUniqueKey, UniquelyKeyedProxyHashTraits> UniquelyKeyedProxyHash; |
| 263 | |
| 264 | // This holds the texture proxies that have unique keys. The resourceCache does not get a ref |
| 265 | // on these proxies but they must send a message to the resourceCache when they are deleted. |
| 266 | UniquelyKeyedProxyHash fUniquelyKeyedProxies; |
| 267 | |
| 268 | GrResourceProvider* fResourceProvider; |
| 269 | GrResourceCache* fResourceCache; |
Robert Phillips | 4d12051 | 2018-01-19 13:22:07 -0500 | [diff] [blame] | 270 | bool fAbandoned; |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 271 | sk_sp<const GrCaps> fCaps; |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 272 | // If this provider is owned by a DDLContext then this is the DirectContext's ID. |
| 273 | uint32_t fContextUniqueID; |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 274 | |
| 275 | // In debug builds we guard against improper thread handling |
| 276 | SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
| 277 | }; |
| 278 | |
| 279 | #endif |