From 4df1656f0f728ed428c3ab8f7beb19703b27c28e Mon Sep 17 00:00:00 2001 From: robertphillips Date: Thu, 28 Apr 2016 15:09:34 -0700 Subject: Tighten up SkSpecialSurface factory functions This is split out of https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1925313002 Review-Url: https://codereview.chromium.org/1925313002 --- tests/SpecialSurfaceTest.cpp | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'tests/SpecialSurfaceTest.cpp') diff --git a/tests/SpecialSurfaceTest.cpp b/tests/SpecialSurfaceTest.cpp index 8c560fef79..3c351a527c 100644 --- a/tests/SpecialSurfaceTest.cpp +++ b/tests/SpecialSurfaceTest.cpp @@ -79,35 +79,11 @@ DEF_TEST(SpecialSurface_Raster2, reporter) { #if SK_SUPPORT_GPU DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, ctxInfo) { - GrSurfaceDesc desc; - desc.fConfig = kSkia8888_GrPixelConfig; - desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fWidth = kSmallerSize; - desc.fHeight = kSmallerSize; - - sk_sp surf(SkSpecialSurface::MakeRenderTarget(ctxInfo.fGrContext, desc)); + sk_sp surf(SkSpecialSurface::MakeRenderTarget(ctxInfo.fGrContext, + kSmallerSize, kSmallerSize, + kSkia8888_GrPixelConfig)); test_surface(surf, reporter, 0); } -// test the more flexible factory -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SpecialSurface_Gpu2, reporter, ctxInfo) { - GrSurfaceDesc desc; - desc.fConfig = kSkia8888_GrPixelConfig; - desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fWidth = kFullSize; - desc.fHeight = kFullSize; - - sk_sp temp(ctxInfo.fGrContext->textureProvider()->createApproxTexture(desc)); - SkASSERT_RELEASE(temp); - - const SkIRect subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); - - sk_sp surf(SkSpecialSurface::MakeFromTexture(subset, std::move(temp))); - - test_surface(surf, reporter, kPad); - - // TODO: check that the clear didn't escape the active region -} - #endif -- cgit v1.2.3