Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: tests/GLProgramsTest.cpp

Issue 1338403003: Revert of Test that GrFragmentProcessors work without input colors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrXfermodeFragmentProcessor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GLProgramsTest.cpp
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index ad23bfbb74c91859236daa58214171c829815a61..ce86c9bf38a7ff1807f07f18cab681edaa3fa521 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -94,49 +94,6 @@
const GrFragmentProcessor* BigKeyProcessor::TestCreate(GrProcessorTestData*) {
return BigKeyProcessor::Create();
}
-
-//////////////////////////////////////////////////////////////////////////////
-
-class BlockInputFragmentProcessor : public GrFragmentProcessor {
-public:
- static GrFragmentProcessor* Create(const GrFragmentProcessor* fp) {
- return new BlockInputFragmentProcessor(fp);
- }
-
- const char* name() const override { return "Block Input"; }
-
- GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLFP; }
-
-private:
- class GLFP : public GrGLFragmentProcessor {
- public:
- void emitCode(EmitArgs& args) override {
- this->emitChild(0, nullptr, args.fOutputColor, args);
- }
-
- private:
- typedef GrGLFragmentProcessor INHERITED;
- };
-
- BlockInputFragmentProcessor(const GrFragmentProcessor* child) {
- this->initClassID<BlockInputFragmentProcessor>();
- this->registerChildProcessor(child);
- }
-
- void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override {}
-
- bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
-
- void onComputeInvariantOutput(GrInvariantOutput* inout) const override {
- inout->setToOther(kRGBA_GrColorComponentFlags, GrColor_WHITE,
- GrInvariantOutput::kWillNot_ReadInput);
- this->childProcessor(0).computeInvariantOutput(inout);
- }
-
- typedef GrFragmentProcessor INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
/*
* Begin test code
@@ -175,7 +132,7 @@
}
static void set_random_xpf(GrPipelineBuilder* pipelineBuilder, GrProcessorTestData* d) {
- SkAutoTUnref<const GrXPFactory> xpf(GrProcessorTestFactory<GrXPFactory>::Create(d));
+ SkAutoTUnref<const GrXPFactory> xpf(GrProcessorTestFactory<GrXPFactory>::CreateStage(d));
SkASSERT(xpf);
pipelineBuilder->setXPFactory(xpf.get());
}
@@ -194,7 +151,7 @@
if (terminate) {
const GrFragmentProcessor* fp;
while (true) {
- fp = GrProcessorTestFactory<GrFragmentProcessor>::Create(d);
+ fp = GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(d);
SkASSERT(fp);
if (0 == fp->numChildProcessors()) {
break;
@@ -244,7 +201,7 @@
for (int s = 0; s < numProcs;) {
SkAutoTUnref<const GrFragmentProcessor> fp(
- GrProcessorTestFactory<GrFragmentProcessor>::Create(d));
+ GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(d));
SkASSERT(fp);
// finally add the stage to the correct pipeline in the drawstate
@@ -352,42 +309,9 @@
this->drawBatch(pipelineBuilder, batch);
}
+
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)
this->flush();
-
- // Validate that GrFPs work correctly without an input.
- GrSurfaceDesc rtDesc;
- rtDesc.fWidth = kRenderTargetWidth;
- rtDesc.fHeight = kRenderTargetHeight;
- rtDesc.fFlags = kRenderTarget_GrSurfaceFlag;
- rtDesc.fConfig = kRGBA_8888_GrPixelConfig;
- SkAutoTUnref<GrRenderTarget> rt(
- fContext->textureProvider()->createTexture(rtDesc, false)->asRenderTarget());
- int fpFactoryCnt = GrProcessorTestFactory<GrFragmentProcessor>::Count();
- for (int i = 0; i < fpFactoryCnt; ++i) {
- // Since FP factories internally randomize, call each 10 times.
- for (int j = 0; j < 10; ++j) {
- SkAutoTUnref<GrDrawBatch> batch(GrRandomDrawBatch(&random, context));
- SkASSERT(batch);
- GrProcessorDataManager procDataManager;
- GrProcessorTestData ptd(&random, context, &procDataManager, this->caps(),
- dummyTextures);
- GrPipelineBuilder builder;
- builder.setXPFactory(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref();
- builder.setRenderTarget(rt);
- builder.setClip(clip);
-
- SkAutoTUnref<const GrFragmentProcessor> fp(
- GrProcessorTestFactory<GrFragmentProcessor>::CreateIdx(i, &ptd));
- SkAutoTUnref<const GrFragmentProcessor> blockFP(
- BlockInputFragmentProcessor::Create(fp));
- builder.addColorFragmentProcessor(blockFP);
-
- this->drawBatch(builder, batch);
- this->flush();
- }
- }
-
return true;
}
« no previous file with comments | « src/gpu/effects/GrXfermodeFragmentProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698