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 <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp
index 63a8d94..d034961 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_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 @@
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 @@
sk_sp<GrSurfaceContext> 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 @@
for (auto flags : { kNone_GrSurfaceFlags, kRenderTarget_GrSurfaceFlag }) {
copySrcDesc.fFlags = flags;
- sk_sp<GrTextureProxy> src(GrSurfaceProxy::MakeDeferred(*context->caps(),
- context->resourceProvider(),
+ sk_sp<GrTextureProxy> 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);
}
}