OLD | NEW |
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" | |
20 #include "SkChecksum.h" | 19 #include "SkChecksum.h" |
21 #include "SkRandom.h" | 20 #include "SkRandom.h" |
22 #include "Test.h" | 21 #include "Test.h" |
23 #include "effects/GrConfigConversionEffect.h" | 22 #include "effects/GrConfigConversionEffect.h" |
24 #include "effects/GrPorterDuffXferProcessor.h" | |
25 #include "gl/GrGLPathRendering.h" | 23 #include "gl/GrGLPathRendering.h" |
26 #include "gl/GrGpuGL.h" | 24 #include "gl/GrGpuGL.h" |
27 #include "gl/builders/GrGLProgramBuilder.h" | 25 #include "gl/builders/GrGLProgramBuilder.h" |
28 | 26 |
29 /* | 27 /* |
30 * A dummy processor which just tries to insert a massive key and verify that it
can retrieve the | 28 * A dummy processor which just tries to insert a massive key and verify that it
can retrieve the |
31 * whole thing correctly | 29 * whole thing correctly |
32 */ | 30 */ |
33 static const uint32_t kMaxKeySize = 1024; | 31 static const uint32_t kMaxKeySize = 1024; |
34 | 32 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 GrBlendCoeff src; | 260 GrBlendCoeff src; |
263 do { | 261 do { |
264 src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub
licGrBlendCoeff)); | 262 src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub
licGrBlendCoeff)); |
265 } while (GrBlendCoeffRefsSrc(src)); | 263 } while (GrBlendCoeffRefsSrc(src)); |
266 | 264 |
267 GrBlendCoeff dst; | 265 GrBlendCoeff dst; |
268 do { | 266 do { |
269 dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub
licGrBlendCoeff)); | 267 dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub
licGrBlendCoeff)); |
270 } while (GrBlendCoeffRefsDst(dst)); | 268 } while (GrBlendCoeffRefsDst(dst)); |
271 | 269 |
272 GrXPFactory* xpFactory = GrPorterDuffXPFactory::Create(src, dst); | 270 ds->setBlendFunc(src, dst); |
273 ds->setXPFactory(xpFactory)->unref(); | |
274 } | 271 } |
275 | 272 |
276 // right now, the only thing we seem to care about in drawState's stencil is 'do
esWrite()' | 273 // right now, the only thing we seem to care about in drawState's stencil is 'do
esWrite()' |
277 static void set_random_stencil(GrDrawState* ds, SkRandom* random) { | 274 static void set_random_stencil(GrDrawState* ds, SkRandom* random) { |
278 GR_STATIC_CONST_SAME_STENCIL(kDoesWriteStencil, | 275 GR_STATIC_CONST_SAME_STENCIL(kDoesWriteStencil, |
279 kReplace_StencilOp, | 276 kReplace_StencilOp, |
280 kReplace_StencilOp, | 277 kReplace_StencilOp, |
281 kAlways_StencilFunc, | 278 kAlways_StencilFunc, |
282 0xffff, | 279 0xffff, |
283 0xffff, | 280 0xffff, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 431 } |
435 #endif | 432 #endif |
436 GrTestTarget target; | 433 GrTestTarget target; |
437 context->getTestTarget(&target); | 434 context->getTestTarget(&target); |
438 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 435 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
439 } | 436 } |
440 } | 437 } |
441 } | 438 } |
442 | 439 |
443 #endif | 440 #endif |
OLD | NEW |