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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 1334293003: Create fragment processor for performing input color blend with child processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLSLBlend.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 // This is a GPU-backend specific test. It relies on static intializers to work 9 // This is a GPU-backend specific test. It relies on static intializers to work
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 const int maxTreeLevels = 4; 241 const int maxTreeLevels = 4;
242 SkAutoTUnref<const GrFragmentProcessor> fp( 242 SkAutoTUnref<const GrFragmentProcessor> fp(
243 create_random_proc_tree(d, 2, maxTreeLev els)); 243 create_random_proc_tree(d, 2, maxTreeLev els));
244 pipelineBuilder->addColorFragmentProcessor(fp); 244 pipelineBuilder->addColorFragmentProcessor(fp);
245 } else { 245 } else {
246 int numProcs = d->fRandom->nextULessThan(maxStages + 1); 246 int numProcs = d->fRandom->nextULessThan(maxStages + 1);
247 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1); 247 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1);
248 248
249 for (int s = 0; s < numProcs;) { 249 for (int s = 0; s < numProcs;) {
250 SkAutoTUnref<const GrFragmentProcessor> fp( 250 SkAutoTUnref<const GrFragmentProcessor> fp(
251 GrProcessorTestFactory<GrFragmentProcessor>::Create(d)); 251 GrProcessorTestFactory<GrFragmentProcessor>::Create(d));
252 SkASSERT(fp); 252 SkASSERT(fp);
253 253
254 // finally add the stage to the correct pipeline in the drawstate 254 // finally add the stage to the correct pipeline in the drawstate
255 if (s < numColorProcs) { 255 if (s < numColorProcs) {
256 pipelineBuilder->addColorFragmentProcessor(fp); 256 pipelineBuilder->addColorFragmentProcessor(fp);
257 } else { 257 } else {
258 pipelineBuilder->addCoverageFragmentProcessor(fp); 258 pipelineBuilder->addCoverageFragmentProcessor(fp);
259 } 259 }
260 ++s; 260 ++s;
261 } 261 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 442 }
443 #endif 443 #endif
444 GrTestTarget target; 444 GrTestTarget target;
445 context->getTestTarget(&target); 445 context->getTestTarget(&target);
446 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context, maxStages)); 446 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context, maxStages));
447 } 447 }
448 } 448 }
449 } 449 }
450 450
451 #endif 451 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLSLBlend.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698