diff options
author | robertphillips <robertphillips@google.com> | 2016-04-28 15:09:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 15:09:34 -0700 |
commit | 4df1656f0f728ed428c3ab8f7beb19703b27c28e (patch) | |
tree | 6c3c7fd910308f6e2b12a05df43be1f7cc279825 /tests | |
parent | 175dd9b5e3d7d749738dac743d2ac360b5340187 (diff) |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageFilterTest.cpp | 9 | ||||
-rw-r--r-- | tests/SpecialSurfaceTest.cpp | 30 |
2 files changed, 6 insertions, 33 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 54e9a60007..56b3aaf5cd 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -370,12 +370,9 @@ static sk_sp<SkImageFilter> make_blue(sk_sp<SkImageFilter> input, static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context, int widthHeight) { #if SK_SUPPORT_GPU if (context) { - GrSurfaceDesc desc; - desc.fConfig = kSkia8888_GrPixelConfig; - desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fWidth = widthHeight; - desc.fHeight = widthHeight; - return SkSpecialSurface::MakeRenderTarget(context, desc); + return SkSpecialSurface::MakeRenderTarget(context, + widthHeight, widthHeight, + kSkia8888_GrPixelConfig); } else #endif { 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<SkSpecialSurface> surf(SkSpecialSurface::MakeRenderTarget(ctxInfo.fGrContext, desc)); + sk_sp<SkSpecialSurface> 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<GrTexture> temp(ctxInfo.fGrContext->textureProvider()->createApproxTexture(desc)); - SkASSERT_RELEASE(temp); - - const SkIRect subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); - - sk_sp<SkSpecialSurface> surf(SkSpecialSurface::MakeFromTexture(subset, std::move(temp))); - - test_surface(surf, reporter, kPad); - - // TODO: check that the clear didn't escape the active region -} - #endif |