From 1b35256f1166358056b2aad8ce09caa6f07912d5 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 5 Apr 2017 18:56:21 +0000 Subject: Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)" This reverts commit aaee31f18c0845417103d84285e365575def3c40. Reason for revert: possible valgrind leak Original change's description: > Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2) > > This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling. > > This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv) > > Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148 > Reviewed-on: https://skia-review.googlesource.com/11326 > Reviewed-by: Brian Salomon > Commit-Queue: Robert Phillips > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia0b92bf6402cb5f9607310d356f43bff2e3e75eb Reviewed-on: https://skia-review.googlesource.com/11361 Reviewed-by: Robert Phillips Commit-Queue: Robert Phillips --- tests/ReadWriteAlphaTest.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tests/ReadWriteAlphaTest.cpp') diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index 2a68191a2d..ac34b9dc32 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -159,10 +159,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { rgbaData[y * X_SIZE + x] = GrColorPackRGBA(6, 7, 8, alphaData[y * X_SIZE + x]); } } - sk_sp proxy = - GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, SkBudgeted::kNo, - rgbaData, 0); - if (!proxy) { + sk_sp texture( + context->resourceProvider()->createTexture(desc, SkBudgeted::kNo, rgbaData, 0)); + if (!texture) { // We always expect to be able to create a RGBA texture if (!rt && kRGBA_8888_GrPixelConfig == desc.fConfig) { ERRORF(reporter, "Failed to create RGBA texture."); @@ -178,10 +177,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { memset(readback.get(), kClearValue, nonZeroRowBytes * Y_SIZE); // read the texture back - bool result = context->contextPriv().readSurfacePixels( - proxy.get(), nullptr, - 0, 0, desc.fWidth, desc.fHeight, - kAlpha_8_GrPixelConfig, nullptr, + bool result = texture->readPixels(0, 0, desc.fWidth, desc.fHeight, + kAlpha_8_GrPixelConfig, readback.get(), rowBytes); REPORTER_ASSERT_MESSAGE(reporter, result, "8888 readPixels failed"); -- cgit v1.2.3