aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TestUtils.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-14 14:39:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-14 21:23:44 +0000
commit26c90e04797e15c37ec00e0f836292b8a207d294 (patch)
treec5a86abbf8cfa796a87df49a157de0e12de18f87 /tests/TestUtils.cpp
parent97180af7f5e577a451367aa0c15cfaff1b6076f5 (diff)
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>
Diffstat (limited to 'tests/TestUtils.cpp')
-rw-r--r--tests/TestUtils.cpp15
1 files changed, 7 insertions, 8 deletions
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<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 @@ void test_copy_to_surface(skiatest::Reporter* reporter, GrContext* context,
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);
}
}