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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrPorterDuffXferProcessor.cpp ('k') | no next file » | 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
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 13 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
14 14
15 #include "GrContextFactory.h" 15 #include "GrContextFactory.h"
16 #include "GrInvariantOutput.h" 16 #include "GrInvariantOutput.h"
17 #include "GrOptDrawState.h" 17 #include "GrOptDrawState.h"
18 #include "GrTest.h" 18 #include "GrTest.h"
19 #include "GrXferProcessor.h"
19 #include "SkChecksum.h" 20 #include "SkChecksum.h"
20 #include "SkRandom.h" 21 #include "SkRandom.h"
21 #include "Test.h" 22 #include "Test.h"
22 #include "effects/GrConfigConversionEffect.h" 23 #include "effects/GrConfigConversionEffect.h"
24 #include "effects/GrPorterDuffXferProcessor.h"
23 #include "gl/GrGLPathRendering.h" 25 #include "gl/GrGLPathRendering.h"
24 #include "gl/GrGpuGL.h" 26 #include "gl/GrGpuGL.h"
25 #include "gl/builders/GrGLProgramBuilder.h" 27 #include "gl/builders/GrGLProgramBuilder.h"
26 28
27 /* 29 /*
28 * A dummy processor which just tries to insert a massive key and verify that it can retrieve the 30 * A dummy processor which just tries to insert a massive key and verify that it can retrieve the
29 * whole thing correctly 31 * whole thing correctly
30 */ 32 */
31 static const uint32_t kMaxKeySize = 1024; 33 static const uint32_t kMaxKeySize = 1024;
32 34
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 GrBlendCoeff src; 262 GrBlendCoeff src;
261 do { 263 do {
262 src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub licGrBlendCoeff)); 264 src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub licGrBlendCoeff));
263 } while (GrBlendCoeffRefsSrc(src)); 265 } while (GrBlendCoeffRefsSrc(src));
264 266
265 GrBlendCoeff dst; 267 GrBlendCoeff dst;
266 do { 268 do {
267 dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub licGrBlendCoeff)); 269 dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub licGrBlendCoeff));
268 } while (GrBlendCoeffRefsDst(dst)); 270 } while (GrBlendCoeffRefsDst(dst));
269 271
270 ds->setBlendFunc(src, dst); 272 GrXPFactory* xpFactory = GrPorterDuffXPFactory::Create(src, dst);
273 ds->setXPFactory(xpFactory)->unref();
271 } 274 }
272 275
273 // right now, the only thing we seem to care about in drawState's stencil is 'do esWrite()' 276 // right now, the only thing we seem to care about in drawState's stencil is 'do esWrite()'
274 static void set_random_stencil(GrDrawState* ds, SkRandom* random) { 277 static void set_random_stencil(GrDrawState* ds, SkRandom* random) {
275 GR_STATIC_CONST_SAME_STENCIL(kDoesWriteStencil, 278 GR_STATIC_CONST_SAME_STENCIL(kDoesWriteStencil,
276 kReplace_StencilOp, 279 kReplace_StencilOp,
277 kReplace_StencilOp, 280 kReplace_StencilOp,
278 kAlways_StencilFunc, 281 kAlways_StencilFunc,
279 0xffff, 282 0xffff,
280 0xffff, 283 0xffff,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 434 }
432 #endif 435 #endif
433 GrTestTarget target; 436 GrTestTarget target;
434 context->getTestTarget(&target); 437 context->getTestTarget(&target);
435 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 438 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
436 } 439 }
437 } 440 }
438 } 441 }
439 442
440 #endif 443 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrPorterDuffXferProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698