diff options
author | Robert Phillips <robertphillips@google.com> | 2017-07-10 12:06:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-11 13:23:41 +0000 |
commit | 8e8c755f56e5dbaf0f87d88a775632010b32e974 (patch) | |
tree | 46c394f09dd769c97d9aeab796c706ecdab0f979 /tests | |
parent | 810c2b657e5d19c38fe5316bd83bdd5ca2c323cf (diff) |
Move GrResourceProvider::createMipMappedTexture to GrSurfaceProxy::MakeDeferredMipMap
Although this adds a new method to GrResourceProvider, it is a slight improvement in that it removes some GrProxy stuff from GrResourceProvider (which arguably should only deal in GrSurface-derived classes).
Bug: skia:
Change-Id: I6d097ed178cd2aa5662770a164135bf2553b80e6
Reviewed-on: https://skia-review.googlesource.com/22023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GrSurfaceTest.cpp | 6 | ||||
-rw-r--r-- | tests/IntTextureTest.cpp | 8 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index 037b55399f..0b0089381a 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -124,8 +124,10 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) { texels[i].fPixels = pixelData.get(); texels[i].fRowBytes = rowBytes >> i; } - sk_sp<GrTextureProxy> proxy = resourceProvider->createMipMappedTexture( - desc, SkBudgeted::kNo, texels.get(), levelCount); + sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferredMipMap(resourceProvider, + desc, SkBudgeted::kNo, + texels.get(), + levelCount); REPORTER_ASSERT(reporter, SkToBool(proxy.get()) == (caps->isConfigTexturable(desc.fConfig) && caps->mipMapSupport() && diff --git a/tests/IntTextureTest.cpp b/tests/IntTextureTest.cpp index 415e7ca0c1..ccdc304976 100644 --- a/tests/IntTextureTest.cpp +++ b/tests/IntTextureTest.cpp @@ -66,10 +66,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(IntTexture, reporter, ctxInfo) { levels[1].fPixels = testData.get(); levels[1].fRowBytes = (kS / 2) * sizeof(int32_t); - sk_sp<GrTextureProxy> temp(context->resourceProvider()->createMipMappedTexture( - desc, - SkBudgeted::kYes, - levels, 2)); + sk_sp<GrTextureProxy> temp(GrSurfaceProxy::MakeDeferredMipMap(context->resourceProvider(), + desc, + SkBudgeted::kYes, + levels, 2)); REPORTER_ASSERT(reporter, !temp); } diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index 334298a444..83d316fcbc 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -1680,7 +1680,8 @@ static sk_sp<GrTextureProxy> make_mipmap_proxy(GrResourceProvider* provider, desc.fSampleCnt = sampleCnt; desc.fIsMipMapped = true; - return provider->createMipMappedTexture(desc, SkBudgeted::kYes, texels.get(), mipLevelCount); + return GrSurfaceProxy::MakeDeferredMipMap(provider, desc, SkBudgeted::kYes, + texels.get(), mipLevelCount); } // Exercise GrSurface::gpuMemorySize for different combos of MSAA, RT-only, |