robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 8 | #include "src/gpu/GrSurfaceProxy.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 9 | #include "src/gpu/GrSurfaceProxyPriv.h" |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 10 | |
Robert Phillips | b7bfbc2 | 2020-07-01 12:55:01 -0400 | [diff] [blame] | 11 | #include "include/gpu/GrRecordingContext.h" |
Brian Salomon | 947efe2 | 2019-07-16 15:36:11 -0400 | [diff] [blame] | 12 | #include "src/core/SkMathPriv.h" |
Mike Reed | 13711eb | 2020-07-14 17:16:32 -0400 | [diff] [blame] | 13 | #include "src/core/SkMipmap.h" |
Greg Daniel | c0d6915 | 2020-10-08 14:59:00 -0400 | [diff] [blame] | 14 | #include "src/gpu/GrAttachment.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 15 | #include "src/gpu/GrCaps.h" |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 16 | #include "src/gpu/GrClip.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 17 | #include "src/gpu/GrGpuResourcePriv.h" |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 18 | #include "src/gpu/GrOpsTask.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 19 | #include "src/gpu/GrProxyProvider.h" |
| 20 | #include "src/gpu/GrRecordingContextPriv.h" |
Robert Phillips | 1a82a4e | 2021-07-01 10:27:44 -0400 | [diff] [blame] | 21 | #include "src/gpu/GrResourceProvider.h" |
Brian Salomon | f7f5433 | 2020-07-28 09:23:35 -0400 | [diff] [blame] | 22 | #include "src/gpu/GrSurface.h" |
Brian Salomon | eebe735 | 2020-12-09 16:37:04 -0500 | [diff] [blame] | 23 | #include "src/gpu/GrSurfaceDrawContext.h" |
Brian Salomon | 4cfae3b | 2020-07-23 10:33:24 -0400 | [diff] [blame] | 24 | #include "src/gpu/GrTexture.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 25 | #include "src/gpu/GrTextureRenderTargetProxy.h" |
Robert Phillips | f2361d2 | 2016-10-25 14:20:06 -0400 | [diff] [blame] | 26 | |
Greg Daniel | 65fa8ca | 2018-01-10 17:06:31 -0500 | [diff] [blame] | 27 | #ifdef SK_DEBUG |
Robert Phillips | 4e105e2 | 2020-07-16 09:18:50 -0400 | [diff] [blame] | 28 | #include "include/gpu/GrDirectContext.h" |
Adlai Holler | a069304 | 2020-10-14 11:23:11 -0400 | [diff] [blame] | 29 | #include "src/gpu/GrDirectContextPriv.h" |
Brian Salomon | 201cdbb | 2019-08-14 17:00:30 -0400 | [diff] [blame] | 30 | #include "src/gpu/GrRenderTarget.h" |
Robert Phillips | c7c2baf | 2018-03-08 09:51:04 -0500 | [diff] [blame] | 31 | |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 32 | static bool is_valid_lazy(const SkISize& dimensions, SkBackingFit fit) { |
Brian Salomon | 1d19da0 | 2019-09-11 17:39:30 -0400 | [diff] [blame] | 33 | // A "fully" lazy proxy's width and height are not known until instantiation time. |
| 34 | // So fully lazy proxies are created with width and height < 0. Regular lazy proxies must be |
| 35 | // created with positive widths and heights. The width and height are set to 0 only after a |
| 36 | // failed instantiation. The former must be "approximate" fit while the latter can be either. |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 37 | return ((dimensions.fWidth < 0 && dimensions.fHeight < 0 && SkBackingFit::kApprox == fit) || |
| 38 | (dimensions.fWidth > 0 && dimensions.fHeight > 0)); |
Greg Daniel | 65fa8ca | 2018-01-10 17:06:31 -0500 | [diff] [blame] | 39 | } |
| 40 | |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 41 | static bool is_valid_non_lazy(SkISize dimensions) { |
| 42 | return dimensions.fWidth > 0 && dimensions.fHeight > 0; |
Greg Daniel | 65fa8ca | 2018-01-10 17:06:31 -0500 | [diff] [blame] | 43 | } |
| 44 | #endif |
| 45 | |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 46 | // Deferred version |
| 47 | GrSurfaceProxy::GrSurfaceProxy(const GrBackendFormat& format, |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 48 | SkISize dimensions, |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 49 | SkBackingFit fit, |
| 50 | SkBudgeted budgeted, |
| 51 | GrProtected isProtected, |
| 52 | GrInternalSurfaceFlags surfaceFlags, |
| 53 | UseAllocator useAllocator) |
Greg Daniel | e320486 | 2018-04-16 11:24:10 -0400 | [diff] [blame] | 54 | : fSurfaceFlags(surfaceFlags) |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 55 | , fFormat(format) |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 56 | , fDimensions(dimensions) |
Greg Daniel | 65fa8ca | 2018-01-10 17:06:31 -0500 | [diff] [blame] | 57 | , fFit(fit) |
| 58 | , fBudgeted(budgeted) |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 59 | , fUseAllocator(useAllocator) |
Adlai Holler | ba52c91 | 2021-02-26 13:16:39 -0500 | [diff] [blame] | 60 | , fIsProtected(isProtected) { |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 61 | SkASSERT(fFormat.isValid()); |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 62 | SkASSERT(is_valid_non_lazy(dimensions)); |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 63 | } |
Jim Van Verth | 1676cb9 | 2019-01-15 13:24:45 -0500 | [diff] [blame] | 64 | |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 65 | // Lazy-callback version |
| 66 | GrSurfaceProxy::GrSurfaceProxy(LazyInstantiateCallback&& callback, |
| 67 | const GrBackendFormat& format, |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 68 | SkISize dimensions, |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 69 | SkBackingFit fit, |
| 70 | SkBudgeted budgeted, |
| 71 | GrProtected isProtected, |
| 72 | GrInternalSurfaceFlags surfaceFlags, |
| 73 | UseAllocator useAllocator) |
| 74 | : fSurfaceFlags(surfaceFlags) |
| 75 | , fFormat(format) |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 76 | , fDimensions(dimensions) |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 77 | , fFit(fit) |
| 78 | , fBudgeted(budgeted) |
| 79 | , fUseAllocator(useAllocator) |
| 80 | , fLazyInstantiateCallback(std::move(callback)) |
Adlai Holler | ba52c91 | 2021-02-26 13:16:39 -0500 | [diff] [blame] | 81 | , fIsProtected(isProtected) { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 82 | SkASSERT(fFormat.isValid()); |
| 83 | SkASSERT(fLazyInstantiateCallback); |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 84 | SkASSERT(is_valid_lazy(dimensions, fit)); |
Chris Dalton | 706a6ff | 2017-11-29 22:01:06 -0700 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | // Wrapped version |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 88 | GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 89 | SkBackingFit fit, |
| 90 | UseAllocator useAllocator) |
Robert Phillips | b520476 | 2019-06-19 14:12:13 -0400 | [diff] [blame] | 91 | : fTarget(std::move(surface)) |
Brian Salomon | f7f5433 | 2020-07-28 09:23:35 -0400 | [diff] [blame] | 92 | , fSurfaceFlags(fTarget->flags()) |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 93 | , fFormat(fTarget->backendFormat()) |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 94 | , fDimensions(fTarget->dimensions()) |
Brian Salomon | bb5711a | 2017-05-17 13:49:59 -0400 | [diff] [blame] | 95 | , fFit(fit) |
Brian Salomon | fa2ebea | 2019-01-24 15:58:58 -0500 | [diff] [blame] | 96 | , fBudgeted(fTarget->resourcePriv().budgetedType() == GrBudgetedType::kBudgeted |
| 97 | ? SkBudgeted::kYes |
| 98 | : SkBudgeted::kNo) |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 99 | , fUseAllocator(useAllocator) |
Brian Salomon | bb5711a | 2017-05-17 13:49:59 -0400 | [diff] [blame] | 100 | , fUniqueID(fTarget->uniqueID()) // Note: converting from unique resource ID to a proxy ID! |
Adlai Holler | ba52c91 | 2021-02-26 13:16:39 -0500 | [diff] [blame] | 101 | , fIsProtected(fTarget->isProtected() ? GrProtected::kYes : GrProtected::kNo) { |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 102 | SkASSERT(fFormat.isValid()); |
Robert Phillips | 019ff27 | 2017-07-24 14:47:57 -0400 | [diff] [blame] | 103 | } |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 104 | |
Robert Phillips | f2361d2 | 2016-10-25 14:20:06 -0400 | [diff] [blame] | 105 | GrSurfaceProxy::~GrSurfaceProxy() { |
Robert Phillips | f2361d2 | 2016-10-25 14:20:06 -0400 | [diff] [blame] | 106 | } |
| 107 | |
Robert Phillips | ba5c439 | 2018-07-25 12:37:14 -0400 | [diff] [blame] | 108 | sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(GrResourceProvider* resourceProvider, |
Brian Salomon | 4eb38b7 | 2019-08-05 12:58:39 -0400 | [diff] [blame] | 109 | int sampleCnt, |
Brian Salomon | f2c2ba9 | 2019-07-17 09:59:59 -0400 | [diff] [blame] | 110 | GrRenderable renderable, |
Brian Salomon | 7e67dca | 2020-07-21 09:27:25 -0400 | [diff] [blame] | 111 | GrMipmapped mipMapped) const { |
| 112 | SkASSERT(mipMapped == GrMipmapped::kNo || fFit == SkBackingFit::kExact); |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 113 | SkASSERT(!this->isLazy()); |
Greg Daniel | d2d8e92 | 2018-02-12 12:07:39 -0500 | [diff] [blame] | 114 | SkASSERT(!fTarget); |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 115 | |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 116 | sk_sp<GrSurface> surface; |
Brian Salomon | a90382f | 2019-09-17 09:01:56 -0400 | [diff] [blame] | 117 | if (SkBackingFit::kApprox == fFit) { |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 118 | surface = resourceProvider->createApproxTexture(fDimensions, fFormat, renderable, sampleCnt, |
Brian Salomon | a90382f | 2019-09-17 09:01:56 -0400 | [diff] [blame] | 119 | fIsProtected); |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 120 | } else { |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 121 | surface = resourceProvider->createTexture(fDimensions, fFormat, renderable, sampleCnt, |
| 122 | mipMapped, fBudgeted, fIsProtected); |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 123 | } |
Robert Phillips | 6504813 | 2017-08-10 08:44:49 -0400 | [diff] [blame] | 124 | if (!surface) { |
| 125 | return nullptr; |
| 126 | } |
| 127 | |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 128 | return surface; |
| 129 | } |
| 130 | |
Brian Salomon | 7d94bb5 | 2018-10-12 14:37:19 -0400 | [diff] [blame] | 131 | bool GrSurfaceProxy::canSkipResourceAllocator() const { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 132 | if (fUseAllocator == UseAllocator::kNo) { |
Robert Phillips | 5f78adf | 2019-04-22 12:41:39 -0400 | [diff] [blame] | 133 | // Usually an atlas or onFlush proxy |
| 134 | return true; |
| 135 | } |
| 136 | |
Brian Salomon | 7d94bb5 | 2018-10-12 14:37:19 -0400 | [diff] [blame] | 137 | auto peek = this->peekSurface(); |
| 138 | if (!peek) { |
| 139 | return false; |
| 140 | } |
| 141 | // If this resource is already allocated and not recyclable then the resource allocator does |
| 142 | // not need to do anything with it. |
| 143 | return !peek->resourcePriv().getScratchKey().isValid(); |
| 144 | } |
| 145 | |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 146 | void GrSurfaceProxy::assign(sk_sp<GrSurface> surface) { |
| 147 | SkASSERT(!fTarget && surface); |
Robert Phillips | abf7b76 | 2018-03-21 12:13:37 -0400 | [diff] [blame] | 148 | |
Greg Daniel | 849dce1 | 2018-04-24 14:32:53 -0400 | [diff] [blame] | 149 | SkDEBUGCODE(this->validateSurface(surface.get());) |
Robert Phillips | abf7b76 | 2018-03-21 12:13:37 -0400 | [diff] [blame] | 150 | |
Robert Phillips | e5f7328 | 2019-06-18 17:15:04 -0400 | [diff] [blame] | 151 | fTarget = std::move(surface); |
robertphillips | 1125a03 | 2016-11-16 11:17:17 -0800 | [diff] [blame] | 152 | |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 153 | #ifdef SK_DEBUG |
Robert Phillips | c7c2baf | 2018-03-08 09:51:04 -0500 | [diff] [blame] | 154 | if (this->asRenderTargetProxy()) { |
| 155 | SkASSERT(fTarget->asRenderTarget()); |
Robert Phillips | c7c2baf | 2018-03-08 09:51:04 -0500 | [diff] [blame] | 156 | } |
| 157 | |
Adlai Holler | ee2837b | 2021-04-09 16:52:48 -0400 | [diff] [blame] | 158 | // In order to give DDL users some flexibility in the destination of there DDLs, |
| 159 | // a DDL's target proxy can be more conservative (and thus require less memory) |
| 160 | // than the actual GrSurface used to fulfill it. |
| 161 | if (!this->isDDLTarget() && kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) { |
Adlai Holler | ba52c91 | 2021-02-26 13:16:39 -0500 | [diff] [blame] | 162 | // TODO(11373): Can this check be exact? |
Robert Phillips | 784b7bf | 2016-12-09 13:35:02 -0500 | [diff] [blame] | 163 | SkASSERT(fTarget->gpuMemorySize() <= this->getRawGpuMemorySize_debugOnly()); |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 164 | } |
| 165 | #endif |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 166 | } |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 167 | |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 168 | bool GrSurfaceProxy::instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt, |
Brian Salomon | 7e67dca | 2020-07-21 09:27:25 -0400 | [diff] [blame] | 169 | GrRenderable renderable, GrMipmapped mipMapped, |
Chris Dalton | 0b68dda | 2019-11-07 21:08:03 -0700 | [diff] [blame] | 170 | const GrUniqueKey* uniqueKey) { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 171 | SkASSERT(!this->isLazy()); |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 172 | if (fTarget) { |
Brian Salomon | 5790420 | 2018-12-17 14:45:00 -0500 | [diff] [blame] | 173 | if (uniqueKey && uniqueKey->isValid()) { |
| 174 | SkASSERT(fTarget->getUniqueKey().isValid() && fTarget->getUniqueKey() == *uniqueKey); |
Robert Phillips | ae7d3f3 | 2017-09-21 08:26:08 -0400 | [diff] [blame] | 175 | } |
Chris Dalton | 0b68dda | 2019-11-07 21:08:03 -0700 | [diff] [blame] | 176 | return true; |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 177 | } |
| 178 | |
Chris Dalton | 0b68dda | 2019-11-07 21:08:03 -0700 | [diff] [blame] | 179 | sk_sp<GrSurface> surface = this->createSurfaceImpl(resourceProvider, sampleCnt, renderable, |
| 180 | mipMapped); |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 181 | if (!surface) { |
| 182 | return false; |
| 183 | } |
| 184 | |
Brian Osman | 28c434b | 2017-09-27 13:11:16 -0400 | [diff] [blame] | 185 | // If there was an invalidation message pending for this key, we might have just processed it, |
| 186 | // causing the key (stored on this proxy) to become invalid. |
| 187 | if (uniqueKey && uniqueKey->isValid()) { |
Robert Phillips | ae7d3f3 | 2017-09-21 08:26:08 -0400 | [diff] [blame] | 188 | resourceProvider->assignUniqueKeyToResource(*uniqueKey, surface.get()); |
| 189 | } |
| 190 | |
Robert Phillips | 5af44de | 2017-07-18 14:49:38 -0400 | [diff] [blame] | 191 | this->assign(std::move(surface)); |
Robert Phillips | fe0253f | 2018-03-16 16:47:25 -0400 | [diff] [blame] | 192 | |
Robert Phillips | eee4d6e | 2017-06-05 09:26:07 -0400 | [diff] [blame] | 193 | return true; |
Robert Phillips | eaa8625 | 2016-11-08 13:49:39 +0000 | [diff] [blame] | 194 | } |
| 195 | |
Brian Salomon | 967df20 | 2018-12-07 11:15:53 -0500 | [diff] [blame] | 196 | void GrSurfaceProxy::deinstantiate() { |
Brian Salomon | fd98c2c | 2018-07-31 17:25:29 -0400 | [diff] [blame] | 197 | SkASSERT(this->isInstantiated()); |
Robert Phillips | e5f7328 | 2019-06-18 17:15:04 -0400 | [diff] [blame] | 198 | fTarget = nullptr; |
Robert Phillips | 4bc7011 | 2018-03-01 10:24:02 -0500 | [diff] [blame] | 199 | } |
| 200 | |
Greg Daniel | d51fa2f | 2020-01-22 16:53:38 -0500 | [diff] [blame] | 201 | void GrSurfaceProxy::computeScratchKey(const GrCaps& caps, GrScratchKey* key) const { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 202 | SkASSERT(!this->isFullyLazy()); |
Brian Salomon | f2c2ba9 | 2019-07-17 09:59:59 -0400 | [diff] [blame] | 203 | GrRenderable renderable = GrRenderable::kNo; |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 204 | int sampleCount = 1; |
Brian Salomon | f2c2ba9 | 2019-07-17 09:59:59 -0400 | [diff] [blame] | 205 | if (const auto* rtp = this->asRenderTargetProxy()) { |
| 206 | renderable = GrRenderable::kYes; |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 207 | sampleCount = rtp->numSamples(); |
Robert Phillips | 57aa367 | 2017-07-21 11:38:13 -0400 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | const GrTextureProxy* tp = this->asTextureProxy(); |
Brian Salomon | 7e67dca | 2020-07-21 09:27:25 -0400 | [diff] [blame] | 211 | GrMipmapped mipMapped = GrMipmapped::kNo; |
Robert Phillips | 57aa367 | 2017-07-21 11:38:13 -0400 | [diff] [blame] | 212 | if (tp) { |
Brian Salomon | 8c82a87 | 2020-07-21 12:09:58 -0400 | [diff] [blame] | 213 | mipMapped = tp->mipmapped(); |
Robert Phillips | 57aa367 | 2017-07-21 11:38:13 -0400 | [diff] [blame] | 214 | } |
| 215 | |
Brian Salomon | 4cfae3b | 2020-07-23 10:33:24 -0400 | [diff] [blame] | 216 | GrTexture::ComputeScratchKey(caps, this->backendFormat(), this->backingStoreDimensions(), |
| 217 | renderable, sampleCount, mipMapped, fIsProtected, key); |
Robert Phillips | 57aa367 | 2017-07-21 11:38:13 -0400 | [diff] [blame] | 218 | } |
| 219 | |
Robert Phillips | e9462dd | 2019-10-23 12:41:29 -0400 | [diff] [blame] | 220 | SkISize GrSurfaceProxy::backingStoreDimensions() const { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 221 | SkASSERT(!this->isFullyLazy()); |
Robert Phillips | a108c92 | 2017-10-10 10:42:19 -0400 | [diff] [blame] | 222 | if (fTarget) { |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 223 | return fTarget->dimensions(); |
Robert Phillips | a108c92 | 2017-10-10 10:42:19 -0400 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | if (SkBackingFit::kExact == fFit) { |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 227 | return fDimensions; |
Robert Phillips | a108c92 | 2017-10-10 10:42:19 -0400 | [diff] [blame] | 228 | } |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 229 | return GrResourceProvider::MakeApprox(fDimensions); |
Robert Phillips | a108c92 | 2017-10-10 10:42:19 -0400 | [diff] [blame] | 230 | } |
| 231 | |
Brian Salomon | 5c60b75 | 2019-12-13 15:03:43 -0500 | [diff] [blame] | 232 | bool GrSurfaceProxy::isFunctionallyExact() const { |
| 233 | SkASSERT(!this->isFullyLazy()); |
| 234 | return fFit == SkBackingFit::kExact || |
| 235 | fDimensions == GrResourceProvider::MakeApprox(fDimensions); |
| 236 | } |
| 237 | |
Greg Daniel | 82c6b10 | 2020-01-21 10:33:22 -0500 | [diff] [blame] | 238 | bool GrSurfaceProxy::isFormatCompressed(const GrCaps* caps) const { |
| 239 | return caps->isFormatCompressed(this->backendFormat()); |
| 240 | } |
| 241 | |
Brian Osman | 45580d3 | 2016-11-23 09:37:01 -0500 | [diff] [blame] | 242 | #ifdef SK_DEBUG |
Robert Phillips | 292a6b2 | 2019-02-14 14:49:02 -0500 | [diff] [blame] | 243 | void GrSurfaceProxy::validate(GrContext_Base* context) const { |
Brian Osman | 45580d3 | 2016-11-23 09:37:01 -0500 | [diff] [blame] | 244 | if (fTarget) { |
Adlai Holler | b81eeba | 2020-06-09 15:20:25 -0400 | [diff] [blame] | 245 | SkASSERT(fTarget->getContext()->priv().matches(context)); |
Brian Osman | 45580d3 | 2016-11-23 09:37:01 -0500 | [diff] [blame] | 246 | } |
Brian Osman | 45580d3 | 2016-11-23 09:37:01 -0500 | [diff] [blame] | 247 | } |
| 248 | #endif |
Robert Phillips | e2f7d18 | 2016-12-15 09:23:05 -0500 | [diff] [blame] | 249 | |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 250 | sk_sp<GrSurfaceProxy> GrSurfaceProxy::Copy(GrRecordingContext* context, |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 251 | sk_sp<GrSurfaceProxy> src, |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 252 | GrSurfaceOrigin origin, |
Brian Salomon | 7e67dca | 2020-07-21 09:27:25 -0400 | [diff] [blame] | 253 | GrMipmapped mipMapped, |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 254 | SkIRect srcRect, |
| 255 | SkBackingFit fit, |
| 256 | SkBudgeted budgeted, |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 257 | RectsMustMatch rectsMustMatch, |
| 258 | sk_sp<GrRenderTask>* outTask) { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 259 | SkASSERT(!src->isFullyLazy()); |
Brian Salomon | 947efe2 | 2019-07-16 15:36:11 -0400 | [diff] [blame] | 260 | int width; |
| 261 | int height; |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 262 | |
| 263 | SkIPoint dstPoint; |
| 264 | if (rectsMustMatch == RectsMustMatch::kYes) { |
Brian Salomon | 947efe2 | 2019-07-16 15:36:11 -0400 | [diff] [blame] | 265 | width = src->width(); |
| 266 | height = src->height(); |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 267 | dstPoint = {srcRect.fLeft, srcRect.fTop}; |
| 268 | } else { |
Brian Salomon | 947efe2 | 2019-07-16 15:36:11 -0400 | [diff] [blame] | 269 | width = srcRect.width(); |
| 270 | height = srcRect.height(); |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 271 | dstPoint = {0, 0}; |
| 272 | } |
| 273 | |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 274 | if (!srcRect.intersect(SkIRect::MakeSize(src->dimensions()))) { |
Greg Daniel | 40903af | 2020-01-30 14:55:05 -0500 | [diff] [blame] | 275 | return {}; |
Robert Phillips | e2f7d18 | 2016-12-15 09:23:05 -0500 | [diff] [blame] | 276 | } |
Greg Daniel | bfa19c4 | 2019-12-19 16:41:40 -0500 | [diff] [blame] | 277 | auto format = src->backendFormat().makeTexture2D(); |
| 278 | SkASSERT(format.isValid()); |
Greg Daniel | bfa19c4 | 2019-12-19 16:41:40 -0500 | [diff] [blame] | 279 | |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 280 | if (src->backendFormat().textureType() != GrTextureType::kExternal) { |
Brian Salomon | 14f99fc | 2020-12-07 12:19:47 -0500 | [diff] [blame] | 281 | GrImageInfo info(GrColorType::kUnknown, kUnknown_SkAlphaType, nullptr, {width, height}); |
| 282 | auto dstContext = GrSurfaceContext::Make(context, |
| 283 | info, |
| 284 | format, |
| 285 | fit, |
| 286 | origin, |
| 287 | GrRenderable::kNo, |
| 288 | 1, |
| 289 | mipMapped, |
| 290 | src->isProtected(), |
| 291 | budgeted); |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 292 | sk_sp<GrRenderTask> copyTask; |
| 293 | if (dstContext && (copyTask = dstContext->copy(src, srcRect, dstPoint))) { |
| 294 | if (outTask) { |
| 295 | *outTask = std::move(copyTask); |
| 296 | } |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 297 | return dstContext->asSurfaceProxyRef(); |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 298 | } |
Greg Daniel | c5167c0 | 2019-06-05 17:36:53 +0000 | [diff] [blame] | 299 | } |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 300 | if (src->asTextureProxy()) { |
Brian Salomon | 590f567 | 2020-12-16 11:44:47 -0500 | [diff] [blame] | 301 | auto dstContext = GrSurfaceFillContext::Make(context, |
| 302 | kUnknown_SkAlphaType, |
Brian Salomon | eebe735 | 2020-12-09 16:37:04 -0500 | [diff] [blame] | 303 | nullptr, |
Brian Salomon | 0263bff | 2020-12-16 08:41:39 -0500 | [diff] [blame] | 304 | {width, height}, |
Brian Salomon | 590f567 | 2020-12-16 11:44:47 -0500 | [diff] [blame] | 305 | fit, |
Brian Salomon | eebe735 | 2020-12-09 16:37:04 -0500 | [diff] [blame] | 306 | format, |
Brian Salomon | 590f567 | 2020-12-16 11:44:47 -0500 | [diff] [blame] | 307 | 1, |
Brian Salomon | eebe735 | 2020-12-09 16:37:04 -0500 | [diff] [blame] | 308 | mipMapped, |
| 309 | src->isProtected(), |
| 310 | GrSwizzle::RGBA(), |
| 311 | GrSwizzle::RGBA(), |
Brian Salomon | 0263bff | 2020-12-16 08:41:39 -0500 | [diff] [blame] | 312 | origin, |
Brian Salomon | 590f567 | 2020-12-16 11:44:47 -0500 | [diff] [blame] | 313 | budgeted); |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 314 | GrSurfaceProxyView view(std::move(src), origin, GrSwizzle::RGBA()); |
Greg Daniel | 573312e | 2020-02-07 17:22:35 -0500 | [diff] [blame] | 315 | if (dstContext && dstContext->blitTexture(std::move(view), srcRect, dstPoint)) { |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 316 | if (outTask) { |
| 317 | *outTask = sk_ref_sp(dstContext->getOpsTask()); |
| 318 | } |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 319 | return dstContext->asSurfaceProxyRef(); |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 320 | } |
Greg Daniel | 4c6f9b7 | 2019-06-06 13:40:59 -0400 | [diff] [blame] | 321 | } |
Greg Daniel | 46cfbc6 | 2019-06-07 11:43:30 -0400 | [diff] [blame] | 322 | // Can't use backend copies or draws. |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 323 | return nullptr; |
Robert Phillips | 63c6746 | 2017-02-15 14:19:01 -0500 | [diff] [blame] | 324 | } |
| 325 | |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 326 | sk_sp<GrSurfaceProxy> GrSurfaceProxy::Copy(GrRecordingContext* context, |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 327 | sk_sp<GrSurfaceProxy> src, |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 328 | GrSurfaceOrigin origin, |
Brian Salomon | 7e67dca | 2020-07-21 09:27:25 -0400 | [diff] [blame] | 329 | GrMipmapped mipMapped, |
Brian Salomon | c524378 | 2020-04-02 12:50:34 -0400 | [diff] [blame] | 330 | SkBackingFit fit, |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 331 | SkBudgeted budgeted, |
| 332 | sk_sp<GrRenderTask>* outTask) { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 333 | SkASSERT(!src->isFullyLazy()); |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 334 | auto rect = SkIRect::MakeSize(src->dimensions()); |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 335 | return Copy(context, |
| 336 | std::move(src), |
| 337 | origin, |
| 338 | mipMapped, |
| 339 | rect, |
| 340 | fit, |
| 341 | budgeted, |
| 342 | RectsMustMatch::kNo, |
| 343 | outTask); |
Robert Phillips | e2f7d18 | 2016-12-15 09:23:05 -0500 | [diff] [blame] | 344 | } |
| 345 | |
Robert Phillips | b520476 | 2019-06-19 14:12:13 -0400 | [diff] [blame] | 346 | #if GR_TEST_UTILS |
| 347 | int32_t GrSurfaceProxy::testingOnly_getBackingRefCnt() const { |
| 348 | if (fTarget) { |
| 349 | return fTarget->testingOnly_getRefCnt(); |
| 350 | } |
| 351 | |
| 352 | return -1; // no backing GrSurface |
| 353 | } |
| 354 | |
| 355 | GrInternalSurfaceFlags GrSurfaceProxy::testingOnly_getFlags() const { |
| 356 | return fSurfaceFlags; |
| 357 | } |
Robert Phillips | 047d5bb | 2021-01-08 13:39:19 -0500 | [diff] [blame] | 358 | |
| 359 | SkString GrSurfaceProxy::dump() const { |
| 360 | SkString tmp; |
| 361 | |
| 362 | tmp.appendf("proxyID: %d - surfaceID: %d", |
| 363 | this->uniqueID().asUInt(), |
| 364 | this->peekSurface() ? this->peekSurface()->uniqueID().asUInt() |
| 365 | : -1); |
| 366 | return tmp; |
| 367 | } |
| 368 | |
Robert Phillips | b520476 | 2019-06-19 14:12:13 -0400 | [diff] [blame] | 369 | #endif |
| 370 | |
Robert Phillips | e897684 | 2019-08-09 08:27:26 -0400 | [diff] [blame] | 371 | void GrSurfaceProxyPriv::exactify(bool allocatedCaseOnly) { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 372 | SkASSERT(!fProxy->isFullyLazy()); |
Robert Phillips | 0ae6faa | 2017-03-21 16:22:00 -0400 | [diff] [blame] | 373 | if (this->isExact()) { |
| 374 | return; |
| 375 | } |
| 376 | |
| 377 | SkASSERT(SkBackingFit::kApprox == fProxy->fFit); |
| 378 | |
| 379 | if (fProxy->fTarget) { |
| 380 | // The kApprox but already instantiated case. Setting the proxy's width & height to |
| 381 | // the instantiated width & height could have side-effects going forward, since we're |
Ben Wagner | 63fd760 | 2017-10-09 15:45:33 -0400 | [diff] [blame] | 382 | // obliterating the area of interest information. This call (exactify) only used |
Robert Phillips | 0ae6faa | 2017-03-21 16:22:00 -0400 | [diff] [blame] | 383 | // when converting an SkSpecialImage to an SkImage so the proxy shouldn't be |
| 384 | // used for additional draws. |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 385 | fProxy->fDimensions = fProxy->fTarget->dimensions(); |
Robert Phillips | 0ae6faa | 2017-03-21 16:22:00 -0400 | [diff] [blame] | 386 | return; |
| 387 | } |
| 388 | |
Robert Phillips | e897684 | 2019-08-09 08:27:26 -0400 | [diff] [blame] | 389 | #ifndef SK_CRIPPLE_TEXTURE_REUSE |
| 390 | // In the post-implicit-allocation world we can't convert this proxy to be exact fit |
| 391 | // at this point. With explicit allocation switching this to exact will result in a |
| 392 | // different allocation at flush time. With implicit allocation, allocation would occur |
| 393 | // at draw time (rather than flush time) so this pathway was encountered less often (if |
| 394 | // at all). |
| 395 | if (allocatedCaseOnly) { |
| 396 | return; |
| 397 | } |
| 398 | #endif |
| 399 | |
Robert Phillips | 0ae6faa | 2017-03-21 16:22:00 -0400 | [diff] [blame] | 400 | // The kApprox uninstantiated case. Making this proxy be exact should be okay. |
| 401 | // It could mess things up if prior decisions were based on the approximate size. |
| 402 | fProxy->fFit = SkBackingFit::kExact; |
| 403 | // If fGpuMemorySize is used when caching specialImages for the image filter DAG. If it has |
Robert Phillips | 6cdc22c | 2017-05-11 16:29:14 -0400 | [diff] [blame] | 404 | // already been computed we want to leave it alone so that amount will be removed when |
Robert Phillips | 0ae6faa | 2017-03-21 16:22:00 -0400 | [diff] [blame] | 405 | // the special image goes away. If it hasn't been computed yet it might as well compute the |
| 406 | // exact amount. |
| 407 | } |
| 408 | |
Greg Daniel | bddcc95 | 2018-01-24 13:22:24 -0500 | [diff] [blame] | 409 | bool GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvider) { |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 410 | SkASSERT(fProxy->isLazy()); |
Chris Dalton | 706a6ff | 2017-11-29 22:01:06 -0700 | [diff] [blame] | 411 | |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 412 | sk_sp<GrSurface> surface; |
Adlai Holler | cc119d9 | 2021-03-16 15:17:25 -0400 | [diff] [blame] | 413 | if (const auto& uniqueKey = fProxy->getUniqueKey(); uniqueKey.isValid()) { |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 414 | // First try to reattach to a cached version if the proxy is uniquely keyed |
Adlai Holler | cc119d9 | 2021-03-16 15:17:25 -0400 | [diff] [blame] | 415 | surface = resourceProvider->findByUniqueKey<GrSurface>(uniqueKey); |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 416 | } |
| 417 | |
Brian Salomon | b6a3a3b | 2019-04-01 12:29:34 -0400 | [diff] [blame] | 418 | bool syncKey = true; |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 419 | bool releaseCallback = false; |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 420 | if (!surface) { |
Brian Salomon | 63410e9 | 2020-03-23 18:32:50 -0400 | [diff] [blame] | 421 | auto result = fProxy->fLazyInstantiateCallback(resourceProvider, fProxy->callbackDesc()); |
Brian Salomon | b6a3a3b | 2019-04-01 12:29:34 -0400 | [diff] [blame] | 422 | surface = std::move(result.fSurface); |
| 423 | syncKey = result.fKeyMode == GrSurfaceProxy::LazyInstantiationKeyMode::kSynced; |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 424 | releaseCallback = surface && result.fReleaseCallback; |
Greg Daniel | 457469c | 2018-02-08 15:05:44 -0500 | [diff] [blame] | 425 | } |
Robert Phillips | e8fabb2 | 2018-02-04 14:33:21 -0500 | [diff] [blame] | 426 | if (!surface) { |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 427 | fProxy->fDimensions.setEmpty(); |
Greg Daniel | bddcc95 | 2018-01-24 13:22:24 -0500 | [diff] [blame] | 428 | return false; |
Chris Dalton | 706a6ff | 2017-11-29 22:01:06 -0700 | [diff] [blame] | 429 | } |
| 430 | |
Brian Salomon | 1d19da0 | 2019-09-11 17:39:30 -0400 | [diff] [blame] | 431 | if (fProxy->isFullyLazy()) { |
Robert Phillips | c1b6066 | 2018-06-26 10:20:08 -0400 | [diff] [blame] | 432 | // This was a fully lazy proxy. We need to fill in the width & height. For partially |
| 433 | // lazy proxies we must preserve the original width & height since that indicates |
| 434 | // the content area. |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 435 | fProxy->fDimensions = surface->dimensions(); |
Robert Phillips | c1b6066 | 2018-06-26 10:20:08 -0400 | [diff] [blame] | 436 | } |
Chris Dalton | 706a6ff | 2017-11-29 22:01:06 -0700 | [diff] [blame] | 437 | |
Brian Salomon | 9f2b86c | 2019-10-22 10:37:46 -0400 | [diff] [blame] | 438 | SkASSERT(fProxy->width() <= surface->width()); |
| 439 | SkASSERT(fProxy->height() <= surface->height()); |
Chris Dalton | f91b755 | 2019-04-29 16:21:18 -0600 | [diff] [blame] | 440 | |
Greg Daniel | 303e83e | 2018-09-10 14:10:19 -0400 | [diff] [blame] | 441 | if (GrTextureProxy* texProxy = fProxy->asTextureProxy()) { |
Brian Salomon | b6a3a3b | 2019-04-01 12:29:34 -0400 | [diff] [blame] | 442 | texProxy->setTargetKeySync(syncKey); |
| 443 | if (syncKey) { |
| 444 | const GrUniqueKey& key = texProxy->getUniqueKey(); |
| 445 | if (key.isValid()) { |
| 446 | if (!surface->asTexture()->getUniqueKey().isValid()) { |
| 447 | // If 'surface' is newly created, attach the unique key |
| 448 | resourceProvider->assignUniqueKeyToResource(key, surface.get()); |
| 449 | } else { |
| 450 | // otherwise we had better have reattached to a cached version |
| 451 | SkASSERT(surface->asTexture()->getUniqueKey() == key); |
| 452 | } |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 453 | } else { |
Brian Salomon | b6a3a3b | 2019-04-01 12:29:34 -0400 | [diff] [blame] | 454 | SkASSERT(!surface->getUniqueKey().isValid()); |
Robert Phillips | 0790f8a | 2018-09-18 13:11:03 -0400 | [diff] [blame] | 455 | } |
Greg Daniel | 303e83e | 2018-09-10 14:10:19 -0400 | [diff] [blame] | 456 | } |
| 457 | } |
| 458 | |
Robert Phillips | e8fabb2 | 2018-02-04 14:33:21 -0500 | [diff] [blame] | 459 | this->assign(std::move(surface)); |
Brian Salomon | beb7f52 | 2019-08-30 16:19:42 -0400 | [diff] [blame] | 460 | if (releaseCallback) { |
| 461 | fProxy->fLazyInstantiateCallback = nullptr; |
| 462 | } |
| 463 | |
Greg Daniel | bddcc95 | 2018-01-24 13:22:24 -0500 | [diff] [blame] | 464 | return true; |
Chris Dalton | 706a6ff | 2017-11-29 22:01:06 -0700 | [diff] [blame] | 465 | } |
| 466 | |
Greg Daniel | 849dce1 | 2018-04-24 14:32:53 -0400 | [diff] [blame] | 467 | #ifdef SK_DEBUG |
| 468 | void GrSurfaceProxy::validateSurface(const GrSurface* surface) { |
Robert Phillips | 8e54a6e | 2020-08-17 14:31:02 -0400 | [diff] [blame] | 469 | SkASSERTF(surface->backendFormat() == fFormat, "%s != %s", |
| 470 | surface->backendFormat().toStr().c_str(), fFormat.toStr().c_str()); |
Greg Daniel | 849dce1 | 2018-04-24 14:32:53 -0400 | [diff] [blame] | 471 | |
Greg Daniel | 849dce1 | 2018-04-24 14:32:53 -0400 | [diff] [blame] | 472 | this->onValidateSurface(surface); |
| 473 | } |
| 474 | #endif |