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

Unified Diff: tests/GLProgramsTest.cpp

Issue 789343002: Revert of Create xfer processor backend. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferBlendSolo
Patch Set: Created 6 years 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/gl/builders/GrGLProgramBuilder.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 953b5e07cbcc45e05dd07a25871f4bf316a3fcdc..253e4aeccc265ceff7c58582a261c8cbc0f6abdf 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -121,14 +121,6 @@
return SkRef(texture->asRenderTarget());
}
-static void set_random_xpf(GrContext* context, const GrDrawTargetCaps& caps, GrDrawState* ds,
- SkRandom* random, GrTexture* dummyTextures[]) {
- SkAutoTUnref<const GrXPFactory> xpf(
- GrProcessorTestFactory<GrXPFactory>::CreateStage(random, context, caps, dummyTextures));
- SkASSERT(xpf);
- ds->setXPFactory(xpf.get());
-}
-
static void set_random_gp(GrContext* context,
const GrDrawTargetCaps& caps,
GrDrawState* ds,
@@ -201,6 +193,22 @@
state |= random->nextBool() * i;
}
ds->enableState(state);
+}
+
+// this function will randomly pick non-self referencing blend modes
+static void set_random_blend_func(GrDrawState* ds, SkRandom* random) {
+ GrBlendCoeff src;
+ do {
+ src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPublicGrBlendCoeff));
+ } while (GrBlendCoeffRefsSrc(src));
+
+ GrBlendCoeff dst;
+ do {
+ dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPublicGrBlendCoeff));
+ } while (GrBlendCoeffRefsDst(dst));
+
+ GrXPFactory* xpFactory = GrPorterDuffXPFactory::Create(src, dst);
+ ds->setXPFactory(xpFactory)->unref();
}
// right now, the only thing we seem to care about in drawState's stencil is 'doesWrite()'
@@ -302,12 +310,9 @@
usePathRendering,
&random,
dummyTextures);
-
- // creates a random xfer processor factory on the draw state
- set_random_xpf(fContext, gpu->glCaps(), &ds, &random, dummyTextures);
-
set_random_hints(&ds, &random);
set_random_state(&ds, &random);
+ set_random_blend_func(&ds, &random);
set_random_stencil(&ds, &random);
GrDeviceCoordTexture dstCopy;
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698