From 8e8c755f56e5dbaf0f87d88a775632010b32e974 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 10 Jul 2017 12:06:05 -0400 Subject: 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 Commit-Queue: Robert Phillips --- tests/GrSurfaceTest.cpp | 6 ++++-- tests/IntTextureTest.cpp | 8 ++++---- tests/ResourceCacheTest.cpp | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'tests') 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 proxy = resourceProvider->createMipMappedTexture( - desc, SkBudgeted::kNo, texels.get(), levelCount); + sk_sp 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 temp(context->resourceProvider()->createMipMappedTexture( - desc, - SkBudgeted::kYes, - levels, 2)); + sk_sp 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 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, -- cgit v1.2.3