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 | |
| 8 | // This is a GPU-backend specific test. |
| 9 | |
| 10 | #include "Test.h" |
| 11 | |
| 12 | #if SK_SUPPORT_GPU |
| 13 | #include "GrSurfaceProxy.h" |
| 14 | #include "GrTextureProxy.h" |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 15 | #include "GrRenderTargetPriv.h" |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 16 | #include "GrRenderTargetProxy.h" |
| 17 | |
robertphillips | 8abb370 | 2016-08-31 14:04:06 -0700 | [diff] [blame] | 18 | // Check that the surface proxy's member vars are set as expected |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 19 | static void check_surface(skiatest::Reporter* reporter, |
| 20 | GrSurfaceProxy* proxy, |
| 21 | GrSurfaceOrigin origin, |
| 22 | int width, int height, |
robertphillips | 8abb370 | 2016-08-31 14:04:06 -0700 | [diff] [blame] | 23 | GrPixelConfig config, |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 24 | const GrGpuResource::UniqueID& uniqueID, |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 25 | SkBudgeted budgeted) { |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 26 | REPORTER_ASSERT(reporter, proxy->origin() == origin); |
| 27 | REPORTER_ASSERT(reporter, proxy->width() == width); |
| 28 | REPORTER_ASSERT(reporter, proxy->height() == height); |
| 29 | REPORTER_ASSERT(reporter, proxy->config() == config); |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 30 | if (!uniqueID.isInvalid()) { |
| 31 | REPORTER_ASSERT(reporter, proxy->uniqueID().asUInt() == uniqueID.asUInt()); |
| 32 | } else { |
| 33 | REPORTER_ASSERT(reporter, !proxy->uniqueID().isInvalid()); |
robertphillips | 8abb370 | 2016-08-31 14:04:06 -0700 | [diff] [blame] | 34 | } |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 35 | REPORTER_ASSERT(reporter, proxy->isBudgeted() == budgeted); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | static void check_rendertarget(skiatest::Reporter* reporter, |
Robert Phillips | ec2249f | 2016-11-09 08:54:35 -0500 | [diff] [blame] | 39 | const GrCaps& caps, |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 40 | GrTextureProvider* provider, |
| 41 | GrRenderTargetProxy* rtProxy, |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 42 | int numSamples, |
Robert Phillips | ec2249f | 2016-11-09 08:54:35 -0500 | [diff] [blame] | 43 | SkBackingFit fit, |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 44 | int expectedMaxWindowRects, |
| 45 | bool wasWrapped) { |
Robert Phillips | ec2249f | 2016-11-09 08:54:35 -0500 | [diff] [blame] | 46 | REPORTER_ASSERT(reporter, rtProxy->maxWindowRectangles(caps) == expectedMaxWindowRects); |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 47 | REPORTER_ASSERT(reporter, rtProxy->numStencilSamples() == numSamples); |
| 48 | |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 49 | GrSurfaceProxy::UniqueID idBefore = rtProxy->uniqueID(); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 50 | GrRenderTarget* rt = rtProxy->instantiate(provider); |
| 51 | REPORTER_ASSERT(reporter, rt); |
| 52 | |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 53 | REPORTER_ASSERT(reporter, rtProxy->uniqueID() == idBefore); |
| 54 | if (wasWrapped) { |
| 55 | // Wrapped resources share their uniqueID with the wrapping RenderTargetProxy |
| 56 | REPORTER_ASSERT(reporter, rtProxy->uniqueID().asUInt() == rt->uniqueID().asUInt()); |
| 57 | } else { |
| 58 | // Deferred resources should always have a different ID from their instantiated rendertarget |
| 59 | REPORTER_ASSERT(reporter, rtProxy->uniqueID().asUInt() != rt->uniqueID().asUInt()); |
| 60 | } |
| 61 | |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 62 | REPORTER_ASSERT(reporter, rt->origin() == rtProxy->origin()); |
| 63 | if (SkBackingFit::kExact == fit) { |
| 64 | REPORTER_ASSERT(reporter, rt->width() == rtProxy->width()); |
| 65 | REPORTER_ASSERT(reporter, rt->height() == rtProxy->height()); |
| 66 | } else { |
| 67 | REPORTER_ASSERT(reporter, rt->width() >= rtProxy->width()); |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 68 | REPORTER_ASSERT(reporter, rt->height() >= rtProxy->height()); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 69 | } |
| 70 | REPORTER_ASSERT(reporter, rt->config() == rtProxy->config()); |
| 71 | |
| 72 | REPORTER_ASSERT(reporter, rt->isUnifiedMultisampled() == rtProxy->isUnifiedMultisampled()); |
| 73 | REPORTER_ASSERT(reporter, rt->isStencilBufferMultisampled() == |
| 74 | rtProxy->isStencilBufferMultisampled()); |
| 75 | REPORTER_ASSERT(reporter, rt->numColorSamples() == rtProxy->numColorSamples()); |
| 76 | REPORTER_ASSERT(reporter, rt->numStencilSamples() == rtProxy->numStencilSamples()); |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 77 | REPORTER_ASSERT(reporter, rt->isMixedSampled() == rtProxy->isMixedSampled()); |
| 78 | REPORTER_ASSERT(reporter, rt->renderTargetPriv().flags() == rtProxy->testingOnly_getFlags()); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | static void check_texture(skiatest::Reporter* reporter, |
| 82 | GrTextureProvider* provider, |
| 83 | GrTextureProxy* texProxy, |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 84 | SkBackingFit fit, |
| 85 | bool wasWrapped) { |
| 86 | GrSurfaceProxy::UniqueID idBefore = texProxy->uniqueID(); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 87 | GrTexture* tex = texProxy->instantiate(provider); |
| 88 | REPORTER_ASSERT(reporter, tex); |
| 89 | |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 90 | REPORTER_ASSERT(reporter, texProxy->uniqueID() == idBefore); |
| 91 | if (wasWrapped) { |
| 92 | // Wrapped resources share their uniqueID with the wrapping TextureProxy |
| 93 | REPORTER_ASSERT(reporter, texProxy->uniqueID().asUInt() == tex->uniqueID().asUInt()); |
| 94 | } else { |
| 95 | // Deferred resources should always have a different ID from their instantiated texture |
| 96 | REPORTER_ASSERT(reporter, texProxy->uniqueID().asUInt() != tex->uniqueID().asUInt()); |
| 97 | } |
| 98 | |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 99 | REPORTER_ASSERT(reporter, tex->origin() == texProxy->origin()); |
| 100 | if (SkBackingFit::kExact == fit) { |
| 101 | REPORTER_ASSERT(reporter, tex->width() == texProxy->width()); |
| 102 | REPORTER_ASSERT(reporter, tex->height() == texProxy->height()); |
| 103 | } else { |
| 104 | REPORTER_ASSERT(reporter, tex->width() >= texProxy->width()); |
| 105 | REPORTER_ASSERT(reporter, tex->height() >= texProxy->height()); |
| 106 | } |
| 107 | REPORTER_ASSERT(reporter, tex->config() == texProxy->config()); |
| 108 | } |
| 109 | |
| 110 | |
robertphillips | 8abb370 | 2016-08-31 14:04:06 -0700 | [diff] [blame] | 111 | DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) { |
bsalomon | 8b7451a | 2016-05-11 06:33:06 -0700 | [diff] [blame] | 112 | GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 113 | const GrCaps& caps = *ctxInfo.grContext()->caps(); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 114 | |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 115 | const GrGpuResource::UniqueID kInvalidResourceID = GrGpuResource::UniqueID::InvalidID(); |
| 116 | |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 117 | int attempt = 0; // useful for debugging |
| 118 | |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 119 | for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }) { |
Robert Phillips | 40d9495 | 2017-01-30 14:15:59 -0500 | [diff] [blame] | 120 | for (auto widthHeight : { 100, 128, 1048576 }) { |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 121 | for (auto config : { kAlpha_8_GrPixelConfig, kRGB_565_GrPixelConfig, |
| 122 | kETC1_GrPixelConfig, kRGBA_8888_GrPixelConfig }) { |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 123 | for (auto fit : { SkBackingFit::kExact, SkBackingFit::kApprox }) { |
| 124 | for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) { |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 125 | for (auto numSamples : { 0, 4, 16, 128 }) { |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 126 | GrSurfaceDesc desc; |
Robert Phillips | 84a8120 | 2016-11-04 11:59:10 -0400 | [diff] [blame] | 127 | desc.fFlags = kRenderTarget_GrSurfaceFlag; |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 128 | desc.fOrigin = origin; |
| 129 | desc.fWidth = widthHeight; |
| 130 | desc.fHeight = widthHeight; |
| 131 | desc.fConfig = config; |
| 132 | desc.fSampleCnt = numSamples; |
| 133 | |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 134 | { |
| 135 | sk_sp<GrTexture> tex; |
| 136 | if (SkBackingFit::kApprox == fit) { |
Robert Phillips | 5c44657 | 2017-02-01 10:53:20 -0500 | [diff] [blame^] | 137 | tex.reset(provider->createApproxTexture(desc)); |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 138 | } else { |
Robert Phillips | 5c44657 | 2017-02-01 10:53:20 -0500 | [diff] [blame^] | 139 | tex.reset(provider->createTexture(desc, budgeted)); |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 140 | } |
| 141 | |
Robert Phillips | 3743013 | 2016-11-09 06:50:43 -0500 | [diff] [blame] | 142 | sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred( |
Robert Phillips | 40d9495 | 2017-01-30 14:15:59 -0500 | [diff] [blame] | 143 | caps, desc, |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 144 | fit, budgeted)); |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 145 | REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(sProxy)); |
Robert Phillips | 40d9495 | 2017-01-30 14:15:59 -0500 | [diff] [blame] | 146 | if (sProxy) { |
| 147 | REPORTER_ASSERT(reporter, sProxy->asRenderTargetProxy()); |
| 148 | // This forces the proxy to compute and cache its |
| 149 | // pre-instantiation size guess. Later, when it is actually |
| 150 | // instantiated, it checks that the instantiated size is <= to |
| 151 | // the pre-computation. If the proxy never computed its |
| 152 | // pre-instantiation size then the check is skipped. |
| 153 | sProxy->gpuMemorySize(); |
Robert Phillips | b446088 | 2016-11-17 14:43:51 -0500 | [diff] [blame] | 154 | |
Robert Phillips | 40d9495 | 2017-01-30 14:15:59 -0500 | [diff] [blame] | 155 | check_surface(reporter, sProxy.get(), origin, |
| 156 | widthHeight, widthHeight, config, |
| 157 | kInvalidResourceID, budgeted); |
| 158 | check_rendertarget(reporter, caps, provider, |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 159 | sProxy->asRenderTargetProxy(), |
| 160 | SkTMin(numSamples, caps.maxSampleCount()), |
Robert Phillips | 40d9495 | 2017-01-30 14:15:59 -0500 | [diff] [blame] | 161 | fit, caps.maxWindowRectangles(), false); |
| 162 | } |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 163 | } |
| 164 | |
Robert Phillips | 84a8120 | 2016-11-04 11:59:10 -0400 | [diff] [blame] | 165 | desc.fFlags = kNone_GrSurfaceFlags; |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 166 | |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 167 | { |
| 168 | sk_sp<GrTexture> tex; |
| 169 | if (SkBackingFit::kApprox == fit) { |
Robert Phillips | 5c44657 | 2017-02-01 10:53:20 -0500 | [diff] [blame^] | 170 | tex.reset(provider->createApproxTexture(desc)); |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 171 | } else { |
Robert Phillips | 5c44657 | 2017-02-01 10:53:20 -0500 | [diff] [blame^] | 172 | tex.reset(provider->createTexture(desc, budgeted)); |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 173 | } |
Robert Phillips | b446088 | 2016-11-17 14:43:51 -0500 | [diff] [blame] | 174 | |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 175 | sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(caps, |
| 176 | desc, |
| 177 | fit, |
| 178 | budgeted)); |
| 179 | REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(sProxy)); |
| 180 | if (sProxy) { |
| 181 | // This forces the proxy to compute and cache its pre-instantiation |
| 182 | // size guess. Later, when it is actually instantiated, it checks |
| 183 | // that the instantiated size is <= to the pre-computation. |
| 184 | // If the proxy never computed its pre-instantiation size then the |
| 185 | // check is skipped. |
| 186 | sProxy->gpuMemorySize(); |
| 187 | |
| 188 | check_surface(reporter, sProxy.get(), origin, |
| 189 | widthHeight, widthHeight, config, |
| 190 | kInvalidResourceID, budgeted); |
| 191 | check_texture(reporter, provider, sProxy->asTextureProxy(), |
| 192 | fit, false); |
| 193 | } |
Robert Phillips | 40d9495 | 2017-01-30 14:15:59 -0500 | [diff] [blame] | 194 | } |
Robert Phillips | 6520a69 | 2017-02-01 09:20:00 -0500 | [diff] [blame] | 195 | |
| 196 | attempt++; |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
egdaniel | ab527a5 | 2016-06-28 08:07:26 -0700 | [diff] [blame] | 205 | DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) { |
bsalomon | 8b7451a | 2016-05-11 06:33:06 -0700 | [diff] [blame] | 206 | GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 207 | const GrCaps& caps = *ctxInfo.grContext()->caps(); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 208 | |
| 209 | static const int kWidthHeight = 100; |
| 210 | |
| 211 | for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }) { |
| 212 | for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfig }) { |
| 213 | for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) { |
| 214 | for (auto numSamples: { 0, 4}) { |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 215 | bool renderable = caps.isConfigRenderable(config, numSamples > 0); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 216 | |
| 217 | GrSurfaceDesc desc; |
| 218 | desc.fOrigin = origin; |
| 219 | desc.fWidth = kWidthHeight; |
| 220 | desc.fHeight = kWidthHeight; |
| 221 | desc.fConfig = config; |
| 222 | desc.fSampleCnt = numSamples; |
| 223 | |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 224 | // External on-screen render target. |
| 225 | if (renderable && kOpenGL_GrBackend == ctxInfo.backend()) { |
| 226 | GrBackendRenderTargetDesc backendDesc; |
| 227 | backendDesc.fWidth = kWidthHeight; |
| 228 | backendDesc.fHeight = kWidthHeight; |
| 229 | backendDesc.fConfig = config; |
| 230 | backendDesc.fOrigin = origin; |
| 231 | backendDesc.fSampleCnt = numSamples; |
| 232 | backendDesc.fStencilBits = 8; |
| 233 | backendDesc.fRenderTargetHandle = 0; |
| 234 | |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 235 | sk_sp<GrRenderTarget> defaultFBO( |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 236 | provider->wrapBackendRenderTarget(backendDesc)); |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 237 | |
Robert Phillips | 3743013 | 2016-11-09 06:50:43 -0500 | [diff] [blame] | 238 | sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(defaultFBO)); |
| 239 | check_surface(reporter, sProxy.get(), origin, |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 240 | kWidthHeight, kWidthHeight, config, |
| 241 | defaultFBO->uniqueID(), SkBudgeted::kNo); |
Robert Phillips | ec2249f | 2016-11-09 08:54:35 -0500 | [diff] [blame] | 242 | check_rendertarget(reporter, caps, provider, sProxy->asRenderTargetProxy(), |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 243 | numSamples, SkBackingFit::kExact, 0, true); |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 244 | } |
| 245 | |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 246 | sk_sp<GrTexture> tex; |
| 247 | |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 248 | // Internal offscreen render target. |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 249 | if (renderable) { |
| 250 | desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 251 | tex.reset(provider->createTexture(desc, budgeted)); |
| 252 | sk_sp<GrRenderTarget> rt(sk_ref_sp(tex->asRenderTarget())); |
| 253 | |
Robert Phillips | 3743013 | 2016-11-09 06:50:43 -0500 | [diff] [blame] | 254 | sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(rt)); |
| 255 | check_surface(reporter, sProxy.get(), origin, |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 256 | kWidthHeight, kWidthHeight, config, |
| 257 | rt->uniqueID(), budgeted); |
Robert Phillips | ec2249f | 2016-11-09 08:54:35 -0500 | [diff] [blame] | 258 | check_rendertarget(reporter, caps, provider, sProxy->asRenderTargetProxy(), |
| 259 | numSamples, SkBackingFit::kExact, |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 260 | caps.maxWindowRectangles(), true); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | if (!tex) { |
| 264 | SkASSERT(kNone_GrSurfaceFlags == desc.fFlags ); |
| 265 | desc.fSampleCnt = 0; |
| 266 | tex.reset(provider->createTexture(desc, budgeted)); |
| 267 | } |
| 268 | |
Robert Phillips | 3743013 | 2016-11-09 06:50:43 -0500 | [diff] [blame] | 269 | sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(tex)); |
| 270 | check_surface(reporter, sProxy.get(), origin, |
Robert Phillips | abacf09 | 2016-11-02 10:23:32 -0400 | [diff] [blame] | 271 | kWidthHeight, kWidthHeight, config, tex->uniqueID(), budgeted); |
Robert Phillips | 3743013 | 2016-11-09 06:50:43 -0500 | [diff] [blame] | 272 | check_texture(reporter, provider, sProxy->asTextureProxy(), |
Robert Phillips | 294870f | 2016-11-11 12:38:40 -0500 | [diff] [blame] | 273 | SkBackingFit::kExact, true); |
robertphillips | 76948d4 | 2016-05-04 12:47:41 -0700 | [diff] [blame] | 274 | } |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | #endif |