diff options
Diffstat (limited to 'tests/CopySurfaceTest.cpp')
-rw-r--r-- | tests/CopySurfaceTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/CopySurfaceTest.cpp b/tests/CopySurfaceTest.cpp index efb6b2d43d..19037d9200 100644 --- a/tests/CopySurfaceTest.cpp +++ b/tests/CopySurfaceTest.cpp @@ -56,6 +56,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CopySurface, reporter, ctxInfo) { {-1 , -1 }, }; + const SkImageInfo ii = SkImageInfo::Make(kW, kH, kRGBA_8888_SkColorType, kPremul_SkAlphaType); + SkAutoTMalloc<uint32_t> read(kW * kH); for (auto sOrigin : {kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin}) { @@ -90,10 +92,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CopySurface, reporter, ctxInfo) { continue; } - sk_sp<GrSurfaceContext> sContext = - context->contextPriv().makeWrappedSurfaceContext(dst, nullptr); + sk_sp<GrSurfaceContext> dstContext = + context->contextPriv().makeWrappedSurfaceContext(std::move(dst), + nullptr); - bool result = sContext->copy(src.get(), srcRect, dstPoint); + bool result = dstContext->copy(src.get(), srcRect, dstPoint); bool expectedResult = true; SkIPoint dstOffset = { dstPoint.fX - srcRect.fLeft, @@ -130,11 +133,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CopySurface, reporter, ctxInfo) { continue; } - GrSurface* dstSurf = dst->instantiate(context->textureProvider()); - sk_memset32(read.get(), 0, kW * kH); - if (!dstSurf->readPixels(0, 0, kW, kH, baseDesc.fConfig, read.get(), - kRowBytes)) { + if (!dstContext->readPixels(ii, read.get(), kRowBytes, 0, 0)) { ERRORF(reporter, "Error calling readPixels"); continue; } |