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