From fb0bd98a43fa11e09705837418167dd72bb4a361 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 4 Apr 2017 16:50:22 -0400 Subject: Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv 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. Change-Id: If57a7de47edc0853dae7bc61337d9acdc03d63b0 Reviewed-on: https://skia-review.googlesource.com/11200 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- tests/FloatingPointTextureTest.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/FloatingPointTextureTest.cpp') diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index 4214e4eebf..5adc2e7892 100644 --- a/tests/FloatingPointTextureTest.cpp +++ b/tests/FloatingPointTextureTest.cpp @@ -17,6 +17,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" +#include "GrContextPriv.h" #include "GrResourceProvider.h" #include "GrTexture.h" #include "SkHalf.h" @@ -51,14 +52,18 @@ void runFPTest(skiatest::Reporter* reporter, GrContext* context, desc.fHeight = DEV_H; desc.fConfig = config; desc.fOrigin = 0 == origin ? kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; - sk_sp fpTexture(context->resourceProvider()->createTexture( - desc, SkBudgeted::kNo, controlPixelData.begin(), 0)); + sk_sp fpProxy = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), + desc, SkBudgeted::kNo, + controlPixelData.begin(), 0); // Floating point textures are NOT supported everywhere - if (nullptr == fpTexture) { + if (!fpProxy) { continue; } - REPORTER_ASSERT(reporter, - fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.begin(), 0)); + bool result = context->contextPriv().readSurfacePixels(fpProxy.get(), nullptr, + 0, 0, DEV_W, DEV_H, + desc.fConfig, nullptr, + readBuffer.begin(), 0); + REPORTER_ASSERT(reporter, result); REPORTER_ASSERT(reporter, 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), readBuffer.bytes())); } -- cgit v1.2.3