diff options
author | Robert Phillips <robertphillips@google.com> | 2017-03-02 18:18:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-03 12:35:27 +0000 |
commit | 2f49314227053dd5acc011e04681faee05c5e0ff (patch) | |
tree | 2669e6d4567687bffea21da299834125124b831d /tests/SpecialImageTest.cpp | |
parent | 3b4c22d3731813d2d0f2ae0e68180b6eeacea7a2 (diff) |
Make GrSurface::MakeDeferred return sk_sp<GrTextureProxy>
This should make upcoming changes less tedious
Change-Id: I313ae9df724f109a64cf5708a974e8bfeb963025
Reviewed-on: https://skia-review.googlesource.com/9183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/SpecialImageTest.cpp')
-rw-r--r-- | tests/SpecialImageTest.cpp | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index 77015c4aa2..82dd019dea 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -233,21 +233,19 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_MakeTexture, reporter, ctxInfo) // gpu const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps()); - sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(), + sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(), context->textureProvider(), desc, SkBudgeted::kNo, bm.getPixels(), bm.rowBytes())); - if (!proxy || !proxy->asTextureProxy()) { + if (!proxy) { return; } sk_sp<SkSpecialImage> gpuImage(SkSpecialImage::MakeDeferredFromGpu( - context, - SkIRect::MakeWH(kFullSize, - kFullSize), - kNeedNewImageUniqueID_SpecialImage, - sk_ref_sp(proxy->asTextureProxy()), - nullptr)); + context, + SkIRect::MakeWH(kFullSize, kFullSize), + kNeedNewImageUniqueID_SpecialImage, + std::move(proxy), nullptr)); { sk_sp<SkSpecialImage> fromGPU(gpuImage->makeTextureImage(context)); @@ -269,11 +267,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, ctxInfo) { const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps()); - sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(), + sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(), context->textureProvider(), desc, SkBudgeted::kNo, bm.getPixels(), bm.rowBytes())); - if (!proxy || !proxy->asTextureProxy()) { + if (!proxy) { return; } @@ -281,18 +279,15 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, ctxInfo) { context, SkIRect::MakeWH(kFullSize, kFullSize), kNeedNewImageUniqueID_SpecialImage, - sk_ref_sp(proxy->asTextureProxy()), - nullptr)); + proxy, nullptr)); const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); { sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu( - context, - subset, + context, subset, kNeedNewImageUniqueID_SpecialImage, - sk_ref_sp(proxy->asTextureProxy()), - nullptr)); + std::move(proxy), nullptr)); test_image(subSImg1, reporter, context, true, kPad, kFullSize); } @@ -312,7 +307,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_DeferredGpu, reporter, ctxInfo) desc.fWidth = kFullSize; desc.fHeight = kFullSize; - sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(), + sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(), context->textureProvider(), desc, SkBudgeted::kNo, bm.getPixels(), 0)); @@ -324,18 +319,15 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_DeferredGpu, reporter, ctxInfo) context, SkIRect::MakeWH(kFullSize, kFullSize), kNeedNewImageUniqueID_SpecialImage, - sk_ref_sp(proxy->asTextureProxy()), - nullptr)); + proxy, nullptr)); const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); { sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu( - context, - subset, + context, subset, kNeedNewImageUniqueID_SpecialImage, - sk_ref_sp(proxy->asTextureProxy()), - nullptr)); + std::move(proxy), nullptr)); test_image(subSImg1, reporter, context, true, kPad, kFullSize); } |