aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProcessorTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-04 16:50:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-05 11:55:35 +0000
commitfb0bd98a43fa11e09705837418167dd72bb4a361 (patch)
tree67579cf4663c41d4b9ec36bbd61020aa3ccbe57f /tests/ProcessorTest.cpp
parentbe5387b9308ad0b92a48a1272b618b6eaa08a771 (diff)
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 <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ProcessorTest.cpp')
-rw-r--r--tests/ProcessorTest.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index b8691f2689..3eb4e16f20 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -146,12 +146,12 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
desc,
SkBackingFit::kExact,
SkBudgeted::kYes));
- sk_sp<GrTexture> texture2(
- context->resourceProvider()->createTexture(desc, SkBudgeted::kYes));
- sk_sp<GrTexture> texture3(
- context->resourceProvider()->createTexture(desc, SkBudgeted::kYes));
- sk_sp<GrTexture> texture4(
- context->resourceProvider()->createTexture(desc, SkBudgeted::kYes));
+ sk_sp<GrTexture> texture2 =
+ context->resourceProvider()->createTexture(desc, SkBudgeted::kYes);
+ sk_sp<GrTexture> texture3 =
+ context->resourceProvider()->createTexture(desc, SkBudgeted::kYes);
+ sk_sp<GrTexture> texture4 =
+ context->resourceProvider()->createTexture(desc, SkBudgeted::kYes);
sk_sp<GrBuffer> buffer(texelBufferSupport
? context->resourceProvider()->createBuffer(
1024, GrBufferType::kTexel_GrBufferType,
@@ -298,6 +298,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor
desc.fFlags = kRenderTarget_GrSurfaceFlag;
desc.fConfig = kRGBA_8888_GrPixelConfig;
+ sk_sp<GrTextureProxy> proxies[2];
+
// Put premul data into the RGBA texture that the test FPs can optionally use.
std::unique_ptr<GrColor[]> rgbaData(new GrColor[256 * 256]);
for (int y = 0; y < 256; ++y) {
@@ -306,8 +308,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor
texel_color(random.nextULessThan(256), random.nextULessThan(256));
}
}
- sk_sp<GrTexture> tex0(context->resourceProvider()->createTexture(
- desc, SkBudgeted::kYes, rgbaData.get(), 256 * sizeof(GrColor)));
+ proxies[0] = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, SkBudgeted::kYes,
+ rgbaData.get(), 256 * sizeof(GrColor));
// Put random values into the alpha texture that the test FPs can optionally use.
desc.fConfig = kAlpha_8_GrPixelConfig;
@@ -317,10 +319,9 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor
alphaData.get()[256 * y + x] = random.nextULessThan(256);
}
}
- sk_sp<GrTexture> tex1(context->resourceProvider()->createTexture(desc, SkBudgeted::kYes,
- alphaData.get(), 256));
- GrTexture* textures[] = {tex0.get(), tex1.get()};
- GrProcessorTestData testData(&random, context, rtc.get(), textures);
+ proxies[1] = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, SkBudgeted::kYes,
+ alphaData.get(), 256);
+ GrProcessorTestData testData(&random, context, rtc.get(), proxies);
// Use a different array of premul colors for the output of the fragment processor that preceeds
// the fragment processor under test.