bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2010 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. |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef GrContext_DEFINED |
| 9 | #define GrContext_DEFINED |
| 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkMatrix.h" |
| 12 | #include "include/core/SkPathEffect.h" |
| 13 | #include "include/core/SkTypes.h" |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 14 | #include "include/gpu/GrBackendSurface.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 15 | #include "include/gpu/GrContextOptions.h" |
| 16 | #include "include/private/GrRecordingContext.h" |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 17 | |
Brian Salomon | 79bf7ac | 2018-05-11 13:08:30 -0400 | [diff] [blame] | 18 | // We shouldn't need this but currently Android is relying on this being include transitively. |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 19 | #include "include/core/SkUnPreMultiply.h" |
Brian Salomon | 79bf7ac | 2018-05-11 13:08:30 -0400 | [diff] [blame] | 20 | |
Robert Phillips | c4039ea | 2018-03-01 11:36:45 -0500 | [diff] [blame] | 21 | class GrAtlasManager; |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 22 | class GrBackendSemaphore; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 23 | class GrCaps; |
robertphillips | 4fd74ae | 2016-08-03 14:26:53 -0700 | [diff] [blame] | 24 | class GrContextPriv; |
bsalomon | 41b952c | 2016-03-11 06:46:33 -0800 | [diff] [blame] | 25 | class GrContextThreadSafeProxy; |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 26 | class GrFragmentProcessor; |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 27 | struct GrGLInterface; |
bsalomon@google.com | 05ef510 | 2011-05-02 21:14:59 +0000 | [diff] [blame] | 28 | class GrGpu; |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 29 | struct GrMockOptions; |
commit-bot@chromium.org | 5c8ee25 | 2013-11-01 15:23:44 +0000 | [diff] [blame] | 30 | class GrPath; |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 31 | class GrRenderTargetContext; |
bsalomon | 0ea80f4 | 2015-02-11 10:49:59 -0800 | [diff] [blame] | 32 | class GrResourceCache; |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 33 | class GrResourceProvider; |
Brian Salomon | 2bbdcc4 | 2017-09-07 12:36:34 -0400 | [diff] [blame] | 34 | class GrSamplerState; |
Robert Phillips | a0bc39d | 2019-01-29 13:14:47 -0500 | [diff] [blame] | 35 | class GrSkSLFPFactoryCache; |
Robert Phillips | 7ee385e | 2017-03-30 08:02:11 -0400 | [diff] [blame] | 36 | class GrSurfaceProxy; |
Robert Phillips | fc711a2 | 2018-02-13 17:03:00 -0500 | [diff] [blame] | 37 | class GrSwizzle; |
kkinnunen | c6cb56f | 2014-06-24 00:12:27 -0700 | [diff] [blame] | 38 | class GrTextContext; |
Mike Reed | 84dd857 | 2017-03-08 22:21:00 -0500 | [diff] [blame] | 39 | class GrTextureProxy; |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 40 | struct GrVkBackendContext; |
bsalomon@google.com | 50398bf | 2011-07-26 20:45:30 +0000 | [diff] [blame] | 41 | |
Mike Reed | 84dd857 | 2017-03-08 22:21:00 -0500 | [diff] [blame] | 42 | class SkImage; |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 43 | class SkSurfaceCharacterization; |
Mike Reed | 84dd857 | 2017-03-08 22:21:00 -0500 | [diff] [blame] | 44 | class SkSurfaceProps; |
Brian Osman | 5127998 | 2017-08-23 10:12:00 -0400 | [diff] [blame] | 45 | class SkTaskGroup; |
Robert Phillips | fc711a2 | 2018-02-13 17:03:00 -0500 | [diff] [blame] | 46 | class SkTraceMemoryDump; |
Mike Reed | 84dd857 | 2017-03-08 22:21:00 -0500 | [diff] [blame] | 47 | |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 48 | class SK_API GrContext : public GrRecordingContext { |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 49 | public: |
| 50 | /** |
Brian Salomon | c1b9c10 | 2018-04-06 09:18:00 -0400 | [diff] [blame] | 51 | * Creates a GrContext for a backend context. If no GrGLInterface is provided then the result of |
| 52 | * GrGLMakeNativeInterface() is used if it succeeds. |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 53 | */ |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 54 | static sk_sp<GrContext> MakeGL(sk_sp<const GrGLInterface>, const GrContextOptions&); |
| 55 | static sk_sp<GrContext> MakeGL(sk_sp<const GrGLInterface>); |
Brian Salomon | c1b9c10 | 2018-04-06 09:18:00 -0400 | [diff] [blame] | 56 | static sk_sp<GrContext> MakeGL(const GrContextOptions&); |
| 57 | static sk_sp<GrContext> MakeGL(); |
| 58 | |
Greg Daniel | 10a83da | 2018-06-14 09:31:11 -0400 | [diff] [blame] | 59 | static sk_sp<GrContext> MakeVulkan(const GrVkBackendContext&, const GrContextOptions&); |
| 60 | static sk_sp<GrContext> MakeVulkan(const GrVkBackendContext&); |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 61 | |
Greg Daniel | b76a72a | 2017-07-13 15:07:54 -0400 | [diff] [blame] | 62 | #ifdef SK_METAL |
| 63 | /** |
| 64 | * Makes a GrContext which uses Metal as the backend. The device parameter is an MTLDevice |
Jim Van Verth | 7730d7c | 2019-05-28 03:03:45 +0000 | [diff] [blame] | 65 | * and queue is an MTLCommandQueue which should be used by the backend. These objects must |
| 66 | * have a ref on them which can be transferred to Ganesh which will release the ref when the |
| 67 | * GrContext is destroyed. |
Greg Daniel | b76a72a | 2017-07-13 15:07:54 -0400 | [diff] [blame] | 68 | */ |
| 69 | static sk_sp<GrContext> MakeMetal(void* device, void* queue, const GrContextOptions& options); |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 70 | static sk_sp<GrContext> MakeMetal(void* device, void* queue); |
Greg Daniel | b76a72a | 2017-07-13 15:07:54 -0400 | [diff] [blame] | 71 | #endif |
| 72 | |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 73 | #ifdef SK_DAWN |
| 74 | static sk_sp<GrContext> MakeDawn(const dawn::Device& device, const GrContextOptions& options); |
| 75 | static sk_sp<GrContext> MakeDawn(const dawn::Device& device); |
| 76 | #endif |
| 77 | |
Greg Daniel | 02611d9 | 2017-07-25 10:05:01 -0400 | [diff] [blame] | 78 | static sk_sp<GrContext> MakeMock(const GrMockOptions*, const GrContextOptions&); |
| 79 | static sk_sp<GrContext> MakeMock(const GrMockOptions*); |
| 80 | |
Robert Phillips | bb60677 | 2019-02-04 17:50:57 -0500 | [diff] [blame] | 81 | ~GrContext() override; |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 82 | |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 83 | sk_sp<GrContextThreadSafeProxy> threadSafeProxy(); |
bsalomon | 41b952c | 2016-03-11 06:46:33 -0800 | [diff] [blame] | 84 | |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 85 | /** |
| 86 | * The GrContext normally assumes that no outsider is setting state |
| 87 | * within the underlying 3D API's context/device/whatever. This call informs |
| 88 | * the context that the state was modified and it should resend. Shouldn't |
| 89 | * be called frequently for good performance. |
bsalomon@google.com | 0a208a1 | 2013-06-28 18:57:35 +0000 | [diff] [blame] | 90 | * The flag bits, state, is dpendent on which backend is used by the |
| 91 | * context, either GL or D3D (possible in future). |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 92 | */ |
bsalomon@google.com | 0a208a1 | 2013-06-28 18:57:35 +0000 | [diff] [blame] | 93 | void resetContext(uint32_t state = kAll_GrBackendState); |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 94 | |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 95 | /** |
Brian Salomon | 1f05d45 | 2019-02-08 12:33:08 -0500 | [diff] [blame] | 96 | * If the backend is GrBackendApi::kOpenGL, then all texture unit/target combinations for which |
| 97 | * the GrContext has modified the bound texture will have texture id 0 bound. This does not |
| 98 | * flush the GrContext. Calling resetContext() does not change the set that will be bound |
| 99 | * to texture id 0 on the next call to resetGLTextureBindings(). After this is called |
| 100 | * all unit/target combinations are considered to have unmodified bindings until the GrContext |
| 101 | * subsequently modifies them (meaning if this is called twice in a row with no intervening |
| 102 | * GrContext usage then the second call is a no-op.) |
| 103 | */ |
| 104 | void resetGLTextureBindings(); |
| 105 | |
| 106 | /** |
Robert Phillips | 88260b5 | 2018-01-19 12:56:09 -0500 | [diff] [blame] | 107 | * Abandons all GPU resources and assumes the underlying backend 3D API context is no longer |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 108 | * usable. Call this if you have lost the associated GPU context, and thus internal texture, |
| 109 | * buffer, etc. references/IDs are now invalid. Calling this ensures that the destructors of the |
| 110 | * GrContext and any of its created resource objects will not make backend 3D API calls. Content |
| 111 | * rendered but not previously flushed may be lost. After this function is called all subsequent |
| 112 | * calls on the GrContext will fail or be no-ops. |
| 113 | * |
| 114 | * The typical use case for this function is that the underlying 3D context was lost and further |
| 115 | * API calls may crash. |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 116 | */ |
Robert Phillips | a9162df | 2019-02-11 14:12:03 -0500 | [diff] [blame] | 117 | void abandonContext() override; |
junov@google.com | 53a5584 | 2011-06-08 22:55:10 +0000 | [diff] [blame] | 118 | |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 119 | /** |
Khushal | c421ca1 | 2018-06-26 14:38:34 -0700 | [diff] [blame] | 120 | * Returns true if the context was abandoned. |
| 121 | */ |
Robert Phillips | a9162df | 2019-02-11 14:12:03 -0500 | [diff] [blame] | 122 | using GrImageContext::abandoned; |
Khushal | c421ca1 | 2018-06-26 14:38:34 -0700 | [diff] [blame] | 123 | |
| 124 | /** |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 125 | * This is similar to abandonContext() however the underlying 3D context is not yet lost and |
| 126 | * the GrContext will cleanup all allocated resources before returning. After returning it will |
| 127 | * assume that the underlying context may no longer be valid. |
| 128 | * |
| 129 | * The typical use case for this function is that the client is going to destroy the 3D context |
| 130 | * but can't guarantee that GrContext will be destroyed first (perhaps because it may be ref'ed |
| 131 | * elsewhere by either the client or Skia objects). |
| 132 | */ |
Robert Phillips | 1056eb8 | 2018-03-01 14:16:41 -0500 | [diff] [blame] | 133 | virtual void releaseResourcesAndAbandonContext(); |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 134 | |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 135 | /////////////////////////////////////////////////////////////////////////// |
| 136 | // Resource Cache |
| 137 | |
Robert Phillips | cf39f37 | 2019-09-03 10:29:20 -0400 | [diff] [blame] | 138 | /** DEPRECATED |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 139 | * Return the current GPU resource cache limits. |
| 140 | * |
Robert Phillips | cf39f37 | 2019-09-03 10:29:20 -0400 | [diff] [blame] | 141 | * @param maxResources If non-null, will be set to -1. |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 142 | * @param maxResourceBytes If non-null, returns maximum number of bytes of |
| 143 | * video memory that can be held in the cache. |
| 144 | */ |
| 145 | void getResourceCacheLimits(int* maxResources, size_t* maxResourceBytes) const; |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 146 | |
| 147 | /** |
Robert Phillips | cf39f37 | 2019-09-03 10:29:20 -0400 | [diff] [blame] | 148 | * Return the current GPU resource cache limit in bytes. |
| 149 | */ |
| 150 | size_t getResourceCacheLimit() const; |
| 151 | |
| 152 | /** |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 153 | * Gets the current GPU resource cache usage. |
| 154 | * |
| 155 | * @param resourceCount If non-null, returns the number of resources that are held in the |
| 156 | * cache. |
| 157 | * @param maxResourceBytes If non-null, returns the total number of bytes of video memory held |
| 158 | * in the cache. |
| 159 | */ |
| 160 | void getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const; |
| 161 | |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 162 | /** |
Derek Sollenberger | ee47914 | 2017-05-24 11:41:33 -0400 | [diff] [blame] | 163 | * Gets the number of bytes in the cache consumed by purgeable (e.g. unlocked) resources. |
| 164 | */ |
| 165 | size_t getResourceCachePurgeableBytes() const; |
| 166 | |
Robert Phillips | cf39f37 | 2019-09-03 10:29:20 -0400 | [diff] [blame] | 167 | /** DEPRECATED |
| 168 | * Specify the GPU resource cache limits. If the current cache exceeds the maxResourceBytes |
| 169 | * limit, it will be purged (LRU) to keep the cache within the limit. |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 170 | * |
Robert Phillips | cf39f37 | 2019-09-03 10:29:20 -0400 | [diff] [blame] | 171 | * @param maxResources Unused. |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 172 | * @param maxResourceBytes The maximum number of bytes of video memory |
| 173 | * that can be held in the cache. |
| 174 | */ |
| 175 | void setResourceCacheLimits(int maxResources, size_t maxResourceBytes); |
commit-bot@chromium.org | 95c2003 | 2014-05-09 14:29:32 +0000 | [diff] [blame] | 176 | |
junov@google.com | 53a5584 | 2011-06-08 22:55:10 +0000 | [diff] [blame] | 177 | /** |
Robert Phillips | cf39f37 | 2019-09-03 10:29:20 -0400 | [diff] [blame] | 178 | * Specify the GPU resource cache limit. If the cache currently exceeds this limit, |
| 179 | * it will be purged (LRU) to keep the cache within the limit. |
| 180 | * |
| 181 | * @param maxResourceBytes The maximum number of bytes of video memory |
| 182 | * that can be held in the cache. |
| 183 | */ |
| 184 | void setResourceCacheLimit(size_t maxResourceBytes); |
| 185 | |
| 186 | /** |
bsalomon@google.com | 1e269b5 | 2012-10-15 14:25:31 +0000 | [diff] [blame] | 187 | * Frees GPU created by the context. Can be called to reduce GPU memory |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 188 | * pressure. |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 189 | */ |
Robert Phillips | 1056eb8 | 2018-03-01 14:16:41 -0500 | [diff] [blame] | 190 | virtual void freeGpuResources(); |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 191 | |
bsalomon@google.com | 07fc0d1 | 2012-06-22 15:15:59 +0000 | [diff] [blame] | 192 | /** |
Jim Van Verth | 76d917c | 2017-12-13 09:26:37 -0500 | [diff] [blame] | 193 | * Purge GPU resources that haven't been used in the past 'msNotUsed' milliseconds or are |
| 194 | * otherwise marked for deletion, regardless of whether the context is under budget. |
Brian Salomon | 5e15085 | 2017-03-22 14:53:13 -0400 | [diff] [blame] | 195 | */ |
Jim Van Verth | 76d917c | 2017-12-13 09:26:37 -0500 | [diff] [blame] | 196 | void performDeferredCleanup(std::chrono::milliseconds msNotUsed); |
Brian Salomon | 5e15085 | 2017-03-22 14:53:13 -0400 | [diff] [blame] | 197 | |
Mike Klein | 4b6bde7 | 2017-12-14 07:46:55 -0500 | [diff] [blame] | 198 | // Temporary compatibility API for Android. |
| 199 | void purgeResourcesNotUsedInMs(std::chrono::milliseconds msNotUsed) { |
| 200 | this->performDeferredCleanup(msNotUsed); |
| 201 | } |
| 202 | |
Derek Sollenberger | 5480a18 | 2017-05-25 16:43:59 -0400 | [diff] [blame] | 203 | /** |
| 204 | * Purge unlocked resources from the cache until the the provided byte count has been reached |
| 205 | * or we have purged all unlocked resources. The default policy is to purge in LRU order, but |
| 206 | * can be overridden to prefer purging scratch resources (in LRU order) prior to purging other |
| 207 | * resource types. |
| 208 | * |
| 209 | * @param maxBytesToPurge the desired number of bytes to be purged. |
| 210 | * @param preferScratchResources If true scratch resources will be purged prior to other |
| 211 | * resource types. |
| 212 | */ |
| 213 | void purgeUnlockedResources(size_t bytesToPurge, bool preferScratchResources); |
| 214 | |
Robert Phillips | 6eba063 | 2018-03-28 12:25:42 -0400 | [diff] [blame] | 215 | /** |
| 216 | * This entry point is intended for instances where an app has been backgrounded or |
| 217 | * suspended. |
| 218 | * If 'scratchResourcesOnly' is true all unlocked scratch resources will be purged but the |
| 219 | * unlocked resources with persistent data will remain. If 'scratchResourcesOnly' is false |
| 220 | * then all unlocked resources will be purged. |
| 221 | * In either case, after the unlocked resources are purged a separate pass will be made to |
| 222 | * ensure that resource usage is under budget (i.e., even if 'scratchResourcesOnly' is true |
| 223 | * some resources with persistent data may be purged to be under budget). |
| 224 | * |
| 225 | * @param scratchResourcesOnly If true only unlocked scratch resources will be purged prior |
| 226 | * enforcing the budget requirements. |
| 227 | */ |
| 228 | void purgeUnlockedResources(bool scratchResourcesOnly); |
| 229 | |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 230 | /** |
Brian Salomon | f932a63 | 2018-04-05 12:46:09 -0400 | [diff] [blame] | 231 | * Gets the maximum supported texture size. |
| 232 | */ |
| 233 | int maxTextureSize() const; |
| 234 | |
| 235 | /** |
| 236 | * Gets the maximum supported render target size. |
| 237 | */ |
| 238 | int maxRenderTargetSize() const; |
| 239 | |
| 240 | /** |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 241 | * Can a SkImage be created with the given color type. |
| 242 | */ |
| 243 | bool colorTypeSupportedAsImage(SkColorType) const; |
| 244 | |
| 245 | /** |
| 246 | * Can a SkSurface be created with the given color type. To check whether MSAA is supported |
| 247 | * use maxSurfaceSampleCountForColorType(). |
| 248 | */ |
| 249 | bool colorTypeSupportedAsSurface(SkColorType colorType) const { |
Robert Phillips | ea1b30b | 2019-09-19 16:05:48 -0400 | [diff] [blame] | 250 | if (kR8G8_unorm_SkColorType == colorType || |
| 251 | kR16G16_unorm_SkColorType == colorType || |
| 252 | kA16_unorm_SkColorType == colorType || |
| 253 | kA16_float_SkColorType == colorType || |
| 254 | kR16G16_float_SkColorType == colorType || |
| 255 | kR16G16B16A16_unorm_SkColorType == colorType || |
Robert Phillips | 429f0d3 | 2019-09-11 17:03:28 -0400 | [diff] [blame] | 256 | kGray_8_SkColorType == colorType) { |
Robert Phillips | d470e1b | 2019-09-04 15:05:35 -0400 | [diff] [blame] | 257 | return false; |
| 258 | } |
| 259 | |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 260 | return this->maxSurfaceSampleCountForColorType(colorType) > 0; |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Gets the maximum supported sample count for a color type. 1 is returned if only non-MSAA |
| 265 | * rendering is supported for the color type. 0 is returned if rendering to this color type |
| 266 | * is not supported at all. |
| 267 | */ |
| 268 | int maxSurfaceSampleCountForColorType(SkColorType) const; |
| 269 | |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 270 | /////////////////////////////////////////////////////////////////////////// |
| 271 | // Misc. |
| 272 | |
Greg Daniel | 06be079 | 2019-04-22 15:53:23 -0400 | [diff] [blame] | 273 | |
| 274 | /** |
| 275 | * Inserts a list of GPU semaphores that the current GPU-backed API must wait on before |
| 276 | * executing any more commands on the GPU. Skia will take ownership of the underlying semaphores |
| 277 | * and delete them once they have been signaled and waited on. If this call returns false, then |
| 278 | * the GPU back-end will not wait on any passed in semaphores, and the client will still own the |
| 279 | * semaphores. |
| 280 | */ |
| 281 | bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores); |
| 282 | |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 283 | /** |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 284 | * Call to ensure all drawing to the context has been issued to the underlying 3D API. |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 285 | */ |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 286 | void flush() { |
Greg Daniel | 797efca | 2019-05-09 14:04:20 -0400 | [diff] [blame] | 287 | this->flush(GrFlushInfo(), GrPrepareForExternalIORequests()); |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 288 | } |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 289 | |
senorblanco@chromium.org | 027de5f | 2011-07-08 18:03:33 +0000 | [diff] [blame] | 290 | /** |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 291 | * Call to ensure all drawing to the context has been issued to the underlying 3D API. |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 292 | * |
Greg Daniel | a3aa75a | 2019-04-12 14:24:55 -0400 | [diff] [blame] | 293 | * If this call returns GrSemaphoresSubmitted::kNo, the GPU backend will not have created or |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 294 | * added any semaphores to signal on the GPU. Thus the client should not have the GPU wait on |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 295 | * any of the semaphores passed in with the GrFlushInfo. However, any pending commands to the |
Greg Daniel | 797efca | 2019-05-09 14:04:20 -0400 | [diff] [blame] | 296 | * context will still be flushed. It should be emphasized that a return value of |
| 297 | * GrSemaphoresSubmitted::kNo does not mean the flush did not happen. It simply means there were |
| 298 | * no semaphores submitted to the GPU. A caller should only take this as a failure if they |
| 299 | * passed in semaphores to be submitted. |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 300 | */ |
Greg Daniel | 797efca | 2019-05-09 14:04:20 -0400 | [diff] [blame] | 301 | GrSemaphoresSubmitted flush(const GrFlushInfo& info) { |
| 302 | return this->flush(info, GrPrepareForExternalIORequests()); |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * Call to ensure all drawing to the context has been issued to the underlying 3D API. |
| 307 | * |
| 308 | * If this call returns GrSemaphoresSubmitted::kNo, the GPU backend will not have created or |
| 309 | * added any semaphores to signal on the GPU. Thus the client should not have the GPU wait on |
| 310 | * any of the semaphores passed in with the GrFlushInfo. However, any pending commands to the |
| 311 | * context will still be flushed. It should be emphasized that a return value of |
| 312 | * GrSemaphoresSubmitted::kNo does not mean the flush did not happen. It simply means there were |
| 313 | * no semaphores submitted to the GPU. A caller should only take this as a failure if they |
| 314 | * passed in semaphores to be submitted. |
| 315 | * |
| 316 | * If the GrPrepareForExternalIORequests contains valid gpu backed SkSurfaces or SkImages, Skia |
| 317 | * will put the underlying backend objects into a state that is ready for external uses. See |
| 318 | * declaration of GrPreopareForExternalIORequests for more details. |
| 319 | */ |
| 320 | GrSemaphoresSubmitted flush(const GrFlushInfo&, const GrPrepareForExternalIORequests&); |
Greg Daniel | b9990e4 | 2019-04-10 16:28:52 -0400 | [diff] [blame] | 321 | |
| 322 | /** |
| 323 | * Deprecated. |
| 324 | */ |
Greg Daniel | d10c901 | 2019-04-22 10:22:41 -0400 | [diff] [blame] | 325 | GrSemaphoresSubmitted flush(GrFlushFlags flags, int numSemaphores, |
Greg Daniel | 5816b3d | 2019-04-22 11:46:41 -0400 | [diff] [blame] | 326 | GrBackendSemaphore signalSemaphores[], |
| 327 | GrGpuFinishedProc finishedProc = nullptr, |
| 328 | GrGpuFinishedContext finishedContext = nullptr) { |
Greg Daniel | d10c901 | 2019-04-22 10:22:41 -0400 | [diff] [blame] | 329 | GrFlushInfo info; |
| 330 | info.fFlags = flags; |
| 331 | info.fNumSemaphores = numSemaphores; |
| 332 | info.fSignalSemaphores = signalSemaphores; |
Greg Daniel | 5816b3d | 2019-04-22 11:46:41 -0400 | [diff] [blame] | 333 | info.fFinishedProc = finishedProc; |
| 334 | info.fFinishedContext = finishedContext; |
Greg Daniel | d10c901 | 2019-04-22 10:22:41 -0400 | [diff] [blame] | 335 | return this->flush(info); |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * Deprecated. |
| 340 | */ |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 341 | GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores, |
Greg Daniel | b9990e4 | 2019-04-10 16:28:52 -0400 | [diff] [blame] | 342 | GrBackendSemaphore signalSemaphores[]) { |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 343 | GrFlushInfo info; |
| 344 | info.fNumSemaphores = numSemaphores; |
| 345 | info.fSignalSemaphores = signalSemaphores; |
| 346 | return this->flush(info); |
Greg Daniel | b9990e4 | 2019-04-10 16:28:52 -0400 | [diff] [blame] | 347 | } |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 348 | |
Brian Salomon | b0d8b76 | 2019-05-06 16:58:22 -0400 | [diff] [blame] | 349 | /** |
| 350 | * Checks whether any asynchronous work is complete and if so calls related callbacks. |
| 351 | */ |
| 352 | void checkAsyncWorkCompletion(); |
| 353 | |
robertphillips | 4fd74ae | 2016-08-03 14:26:53 -0700 | [diff] [blame] | 354 | // Provides access to functions that aren't part of the public API. |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 355 | GrContextPriv priv(); |
| 356 | const GrContextPriv priv() const; |
robertphillips | 4fd74ae | 2016-08-03 14:26:53 -0700 | [diff] [blame] | 357 | |
Robert Phillips | 0c4b7b1 | 2018-03-06 08:20:37 -0500 | [diff] [blame] | 358 | /** Enumerates all cached GPU resources and dumps their memory to traceMemoryDump. */ |
| 359 | // Chrome is using this! |
| 360 | void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const; |
| 361 | |
Khushal | 3e7548c | 2018-05-23 15:45:01 -0700 | [diff] [blame] | 362 | bool supportsDistanceFieldText() const; |
| 363 | |
Greg Daniel | a870b46 | 2019-01-08 15:49:46 -0500 | [diff] [blame] | 364 | void storeVkPipelineCacheData(); |
| 365 | |
Adrienne Walker | 0f82797 | 2019-03-26 13:46:14 -0700 | [diff] [blame] | 366 | static size_t ComputeTextureSize(SkColorType type, int width, int height, GrMipMapped, |
| 367 | bool useNextPow2 = false); |
| 368 | |
Robert Phillips | d5e80ca | 2019-07-29 14:11:35 -0400 | [diff] [blame] | 369 | /* |
| 370 | * Retrieve the default GrBackendFormat for a given SkColorType and renderability. |
| 371 | * It is guaranteed that this backend format will be the one used by the following |
| 372 | * SkColorType and SkSurfaceCharacterization-based createBackendTexture methods. |
| 373 | * |
| 374 | * The caller should check that the returned format is valid. |
| 375 | */ |
Robert Phillips | f759964 | 2019-08-13 16:16:42 -0400 | [diff] [blame] | 376 | GrBackendFormat defaultBackendFormat(SkColorType ct, GrRenderable renderable) const { |
| 377 | return INHERITED::defaultBackendFormat(ct, renderable); |
| 378 | } |
Robert Phillips | d5e80ca | 2019-07-29 14:11:35 -0400 | [diff] [blame] | 379 | |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 380 | /* |
| 381 | * The explicitly allocated backend texture API allows clients to use Skia to create backend |
| 382 | * objects outside of Skia proper (i.e., Skia's caching system will not know about them.) |
| 383 | * |
| 384 | * It is the client's responsibility to delete all these objects (using deleteBackendTexture) |
| 385 | * before deleting the GrContext used to create them. Additionally, clients should only |
| 386 | * delete these objects on the thread for which that GrContext is active. |
| 387 | * |
Robert Phillips | 4bdd36f | 2019-06-04 11:03:06 -0400 | [diff] [blame] | 388 | * The client is responsible for ensuring synchronization between different uses |
| 389 | * of the backend object (i.e., wrapping it in a surface, rendering to it, deleting the |
| 390 | * surface, rewrapping it in a image and drawing the image will require explicit |
| 391 | * sychronization on the client's part). |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 392 | */ |
| 393 | |
| 394 | // If possible, create an uninitialized backend texture. The client should ensure that the |
| 395 | // returned backend texture is valid. |
Robert Phillips | d1d869d | 2019-06-07 14:21:31 -0400 | [diff] [blame] | 396 | // For the Vulkan backend the layout of the created VkImage will be: |
| 397 | // VK_IMAGE_LAYOUT_UNDEFINED. |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 398 | GrBackendTexture createBackendTexture(int width, int height, |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 399 | const GrBackendFormat&, |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 400 | GrMipMapped, |
Emircan Uysaler | 23ca4e7 | 2019-06-24 10:53:09 -0400 | [diff] [blame] | 401 | GrRenderable, |
Robert Phillips | da2e67a | 2019-07-01 15:04:06 -0400 | [diff] [blame] | 402 | GrProtected = GrProtected::kNo); |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 403 | |
| 404 | // If possible, create an uninitialized backend texture. The client should ensure that the |
| 405 | // returned backend texture is valid. |
| 406 | // If successful, the created backend texture will be compatible with the provided |
| 407 | // SkColorType. |
Robert Phillips | d1d869d | 2019-06-07 14:21:31 -0400 | [diff] [blame] | 408 | // For the Vulkan backend the layout of the created VkImage will be: |
| 409 | // VK_IMAGE_LAYOUT_UNDEFINED. |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 410 | GrBackendTexture createBackendTexture(int width, int height, |
| 411 | SkColorType, |
| 412 | GrMipMapped, |
Emircan Uysaler | 23ca4e7 | 2019-06-24 10:53:09 -0400 | [diff] [blame] | 413 | GrRenderable, |
Robert Phillips | da2e67a | 2019-07-01 15:04:06 -0400 | [diff] [blame] | 414 | GrProtected = GrProtected::kNo); |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 415 | |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 416 | |
| 417 | // If possible, create an uninitialized backend texture that is compatible with the |
| 418 | // provided characterization. The client should ensure that the returned backend texture |
| 419 | // is valid. |
| 420 | // For the Vulkan backend the layout of the created VkImage will be: |
| 421 | // VK_IMAGE_LAYOUT_UNDEFINED. |
| 422 | GrBackendTexture createBackendTexture(const SkSurfaceCharacterization& characterization); |
| 423 | |
Robert Phillips | 4bdd36f | 2019-06-04 11:03:06 -0400 | [diff] [blame] | 424 | // If possible, create a backend texture initialized to a particular color. The client should |
| 425 | // ensure that the returned backend texture is valid. |
Robert Phillips | d1d869d | 2019-06-07 14:21:31 -0400 | [diff] [blame] | 426 | // For the Vulkan backend the layout of the created VkImage will be: |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 427 | // VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL if renderable is kNo |
| 428 | // and VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL if renderable is kYes |
Robert Phillips | 4bdd36f | 2019-06-04 11:03:06 -0400 | [diff] [blame] | 429 | GrBackendTexture createBackendTexture(int width, int height, |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 430 | const GrBackendFormat&, |
| 431 | const SkColor4f& color, |
| 432 | GrMipMapped, |
| 433 | GrRenderable, |
Robert Phillips | da2e67a | 2019-07-01 15:04:06 -0400 | [diff] [blame] | 434 | GrProtected = GrProtected::kNo); |
Robert Phillips | 4bdd36f | 2019-06-04 11:03:06 -0400 | [diff] [blame] | 435 | |
| 436 | // If possible, create a backend texture initialized to a particular color. The client should |
| 437 | // ensure that the returned backend texture is valid. |
| 438 | // If successful, the created backend texture will be compatible with the provided |
| 439 | // SkColorType. |
Robert Phillips | d1d869d | 2019-06-07 14:21:31 -0400 | [diff] [blame] | 440 | // For the Vulkan backend the layout of the created VkImage will be: |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 441 | // VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL if renderable is kNo |
| 442 | // and VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL if renderable is kYes |
Robert Phillips | 4bdd36f | 2019-06-04 11:03:06 -0400 | [diff] [blame] | 443 | GrBackendTexture createBackendTexture(int width, int height, |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 444 | SkColorType, |
| 445 | const SkColor4f& color, |
| 446 | GrMipMapped, |
| 447 | GrRenderable, |
Robert Phillips | da2e67a | 2019-07-01 15:04:06 -0400 | [diff] [blame] | 448 | GrProtected = GrProtected::kNo); |
Robert Phillips | 4bdd36f | 2019-06-04 11:03:06 -0400 | [diff] [blame] | 449 | |
Robert Phillips | 02dc030 | 2019-07-02 17:58:27 -0400 | [diff] [blame] | 450 | // If possible, create a backend texture initialized to a particular color that is |
| 451 | // compatible with the provided characterization. The client should ensure that the |
| 452 | // returned backend texture is valid. |
| 453 | // For the Vulkan backend the layout of the created VkImage will be: |
| 454 | // VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL |
| 455 | GrBackendTexture createBackendTexture(const SkSurfaceCharacterization& characterization, |
| 456 | const SkColor4f& color); |
| 457 | |
Robert Phillips | 5c7a25b | 2019-05-20 08:38:07 -0400 | [diff] [blame] | 458 | void deleteBackendTexture(GrBackendTexture); |
| 459 | |
Brian Osman | ed58e00 | 2019-09-06 14:42:43 -0400 | [diff] [blame] | 460 | // This interface allows clients to pre-compile shaders and populate the runtime program cache. |
| 461 | // The key and data blobs should be the ones passed to the PersistentCache, in SkSL format. |
| 462 | // |
| 463 | // Steps to use this API: |
| 464 | // |
| 465 | // 1) Create a GrContext as normal, but set fPersistentCache on GrContextOptions to something |
| 466 | // that will save the cached shader blobs. Set fShaderCacheStrategy to kSkSL. This will |
| 467 | // ensure that the blobs are SkSL, and are suitable for pre-compilation. |
| 468 | // 2) Run your application, and save all of the key/data pairs that are fed to the cache. |
| 469 | // |
| 470 | // 3) Switch over to shipping your application. Include the key/data pairs from above. |
| 471 | // 4) At startup (or any convenient time), call precompileShader for each key/data pair. |
| 472 | // This will compile the SkSL to create a GL program, and populate the runtime cache. |
| 473 | // |
| 474 | // This is only guaranteed to work if the context/device used in step #2 are created in the |
| 475 | // same way as the one used in step #4, and the same GrContextOptions are specified. |
| 476 | // Using cached shader blobs on a different device or driver are undefined. |
| 477 | bool precompileShader(const SkData& key, const SkData& data); |
| 478 | |
Brian Salomon | ec22b1a | 2019-08-09 09:41:48 -0400 | [diff] [blame] | 479 | #ifdef SK_ENABLE_DUMP_GPU |
| 480 | /** Returns a string with detailed information about the context & GPU, in JSON format. */ |
| 481 | SkString dump() const; |
| 482 | #endif |
| 483 | |
Robert Phillips | 88260b5 | 2018-01-19 12:56:09 -0500 | [diff] [blame] | 484 | protected: |
Robert Phillips | a41c685 | 2019-02-07 10:44:10 -0500 | [diff] [blame] | 485 | GrContext(GrBackendApi, const GrContextOptions&, int32_t contextID = SK_InvalidGenID); |
| 486 | |
Robert Phillips | bb60677 | 2019-02-04 17:50:57 -0500 | [diff] [blame] | 487 | bool init(sk_sp<const GrCaps>, sk_sp<GrSkSLFPFactoryCache>) override; |
Robert Phillips | 1056eb8 | 2018-03-01 14:16:41 -0500 | [diff] [blame] | 488 | |
Robert Phillips | 292a6b2 | 2019-02-14 14:49:02 -0500 | [diff] [blame] | 489 | GrContext* asDirectContext() override { return this; } |
| 490 | |
Robert Phillips | 5a66efb | 2018-03-07 15:13:18 -0500 | [diff] [blame] | 491 | virtual GrAtlasManager* onGetAtlasManager() = 0; |
Robert Phillips | 1056eb8 | 2018-03-01 14:16:41 -0500 | [diff] [blame] | 492 | |
Robert Phillips | fde6fa0 | 2018-03-02 08:53:14 -0500 | [diff] [blame] | 493 | sk_sp<GrContextThreadSafeProxy> fThreadSafeProxy; |
Robert Phillips | 1056eb8 | 2018-03-01 14:16:41 -0500 | [diff] [blame] | 494 | |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 495 | private: |
Ethan Nicholas | 8e265a7 | 2018-12-12 16:22:40 -0500 | [diff] [blame] | 496 | // fTaskGroup must appear before anything that uses it (e.g. fGpu), so that it is destroyed |
| 497 | // after all of its users. Clients of fTaskGroup will generally want to ensure that they call |
| 498 | // wait() on it as they are being destroyed, to avoid the possibility of pending tasks being |
| 499 | // invoked after objects they depend upon have already been destroyed. |
| 500 | std::unique_ptr<SkTaskGroup> fTaskGroup; |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 501 | sk_sp<GrGpu> fGpu; |
bsalomon | 41b952c | 2016-03-11 06:46:33 -0800 | [diff] [blame] | 502 | GrResourceCache* fResourceCache; |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 503 | GrResourceProvider* fResourceProvider; |
bsalomon | d309e7a | 2015-04-30 14:18:54 -0700 | [diff] [blame] | 504 | |
bsalomon | 41b952c | 2016-03-11 06:46:33 -0800 | [diff] [blame] | 505 | bool fDidTestPMConversions; |
Brian Osman | 28804f3 | 2017-04-20 10:24:36 -0400 | [diff] [blame] | 506 | // true if the PM/UPM conversion succeeded; false otherwise |
| 507 | bool fPMUPMConversionsRoundTrip; |
bsalomon@google.com | a04e8e8 | 2012-08-27 12:53:13 +0000 | [diff] [blame] | 508 | |
Ethan Nicholas | d1b2eec | 2017-11-01 15:45:43 -0400 | [diff] [blame] | 509 | GrContextOptions::PersistentCache* fPersistentCache; |
Brian Osman | 5e7fbfd | 2019-05-03 13:13:35 -0400 | [diff] [blame] | 510 | GrContextOptions::ShaderErrorHandler* fShaderErrorHandler; |
Ethan Nicholas | d1b2eec | 2017-11-01 15:45:43 -0400 | [diff] [blame] | 511 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 512 | // TODO: have the GrClipStackClip use renderTargetContexts and rm this friending |
robertphillips | 4fd74ae | 2016-08-03 14:26:53 -0700 | [diff] [blame] | 513 | friend class GrContextPriv; |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 514 | |
skia.committer@gmail.com | cdcb2ce | 2013-01-29 07:05:52 +0000 | [diff] [blame] | 515 | /** |
Brian Osman | 5ea96bf | 2018-10-02 14:58:05 -0400 | [diff] [blame] | 516 | * These functions create premul <-> unpremul effects, using the specialized round-trip effects |
| 517 | * from GrConfigConversionEffect. |
bsalomon@google.com | adc6536 | 2013-01-28 14:26:09 +0000 | [diff] [blame] | 518 | */ |
Brian Osman | 5ea96bf | 2018-10-02 14:58:05 -0400 | [diff] [blame] | 519 | std::unique_ptr<GrFragmentProcessor> createPMToUPMEffect(std::unique_ptr<GrFragmentProcessor>); |
| 520 | std::unique_ptr<GrFragmentProcessor> createUPMToPMEffect(std::unique_ptr<GrFragmentProcessor>); |
Brian Osman | 409e74f | 2017-04-17 11:48:28 -0400 | [diff] [blame] | 521 | |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 522 | typedef GrRecordingContext INHERITED; |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 523 | }; |
| 524 | |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 525 | #endif |