aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProcessorTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-05 18:56:21 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-05 18:56:33 +0000
commit1b35256f1166358056b2aad8ce09caa6f07912d5 (patch)
tree9d9bcd6bffc6126d656efefee15bb376dab81d42 /tests/ProcessorTest.cpp
parent1987366b3c0a9dd9280620e62e0edb7d5087a828 (diff)
Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)"
This reverts commit aaee31f18c0845417103d84285e365575def3c40. Reason for revert: possible valgrind leak Original change's description: > Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2) > > 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. > > This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv) > > Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148 > Reviewed-on: https://skia-review.googlesource.com/11326 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia0b92bf6402cb5f9607310d356f43bff2e3e75eb Reviewed-on: https://skia-review.googlesource.com/11361 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ProcessorTest.cpp')
-rw-r--r--tests/ProcessorTest.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 3eb4e16f20..b8691f2689 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,8 +298,6 @@ 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) {
@@ -308,8 +306,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor
texel_color(random.nextULessThan(256), random.nextULessThan(256));
}
}
- proxies[0] = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, SkBudgeted::kYes,
- rgbaData.get(), 256 * sizeof(GrColor));
+ sk_sp<GrTexture> tex0(context->resourceProvider()->createTexture(
+ 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;
@@ -319,9 +317,10 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor
alphaData.get()[256 * y + x] = random.nextULessThan(256);
}
}
- proxies[1] = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, SkBudgeted::kYes,
- alphaData.get(), 256);
- GrProcessorTestData testData(&random, context, rtc.get(), proxies);
+ 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);
// Use a different array of premul colors for the output of the fragment processor that preceeds
// the fragment processor under test.