From 26c90e04797e15c37ec00e0f836292b8a207d294 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 14 Mar 2017 14:39:29 -0400 Subject: Add GrRenderTargetContext::resourceProvider & GrResourceProvider::caps and retract GrSurfaceContextPriv a bit Change-Id: Id47af1052f9bda4fe7c85b3ce46b3ebe37797524 Reviewed-on: https://skia-review.googlesource.com/9647 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- tests/TestUtils.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tests/TestUtils.cpp') diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp index 63a8d94871..d0349614f1 100644 --- a/tests/TestUtils.cpp +++ b/tests/TestUtils.cpp @@ -13,7 +13,7 @@ #include "GrSurfaceProxy.h" #include "GrTextureProxy.h" -void test_read_pixels(skiatest::Reporter* reporter, GrContext* context, +void test_read_pixels(skiatest::Reporter* reporter, GrSurfaceContext* srcContext, uint32_t expectedPixelValues[], const char* testName) { int pixelCnt = srcContext->width() * srcContext->height(); @@ -36,7 +36,7 @@ void test_read_pixels(skiatest::Reporter* reporter, GrContext* context, } } -void test_write_pixels(skiatest::Reporter* reporter, GrContext* context, +void test_write_pixels(skiatest::Reporter* reporter, GrSurfaceContext* dstContext, bool expectedToWork, const char* testName) { int pixelCnt = dstContext->width() * dstContext->height(); @@ -63,7 +63,7 @@ void test_write_pixels(skiatest::Reporter* reporter, GrContext* context, return; } - test_read_pixels(reporter, context, dstContext, pixels.get(), testName); + test_read_pixels(reporter, dstContext, pixels.get(), testName); } void test_copy_from_surface(skiatest::Reporter* reporter, GrContext* context, @@ -83,11 +83,11 @@ void test_copy_from_surface(skiatest::Reporter* reporter, GrContext* context, sk_sp dstContext(GrSurfaceProxy::TestCopy(context, copyDstDesc, proxy)); - test_read_pixels(reporter, context, dstContext.get(), expectedPixelValues, testName); + test_read_pixels(reporter, dstContext.get(), expectedPixelValues, testName); } } -void test_copy_to_surface(skiatest::Reporter* reporter, GrContext* context, +void test_copy_to_surface(skiatest::Reporter* reporter, GrResourceProvider* resourceProvider, GrSurfaceContext* dstContext, const char* testName) { int pixelCnt = dstContext->width() * dstContext->height(); @@ -107,13 +107,12 @@ void test_copy_to_surface(skiatest::Reporter* reporter, GrContext* context, for (auto flags : { kNone_GrSurfaceFlags, kRenderTarget_GrSurfaceFlag }) { copySrcDesc.fFlags = flags; - sk_sp src(GrSurfaceProxy::MakeDeferred(*context->caps(), - context->resourceProvider(), + sk_sp src(GrSurfaceProxy::MakeDeferred(resourceProvider, copySrcDesc, SkBudgeted::kYes, pixels.get(), 0)); dstContext->copy(src.get()); - test_read_pixels(reporter, context, dstContext, pixels.get(), testName); + test_read_pixels(reporter, dstContext, pixels.get(), testName); } } -- cgit v1.2.3