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 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 321 } |
322 | 322 |
323 static void set_random_hints(GrGpuGL* gpu, SkRandom* random) { | 323 static void set_random_hints(GrGpuGL* gpu, SkRandom* random) { |
324 for (int i = 1; i <= GrDrawState::kLast_Hint; i <<= 1) { | 324 for (int i = 1; i <= GrDrawState::kLast_Hint; i <<= 1) { |
325 gpu->drawState()->setHint(GrDrawState::Hints(i), random->nextBool()); | 325 gpu->drawState()->setHint(GrDrawState::Hints(i), random->nextBool()); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 static void set_random_state(GrGpuGL* gpu, SkRandom* random) { | 329 static void set_random_state(GrGpuGL* gpu, SkRandom* random) { |
330 int state = 0; | 330 int state = 0; |
331 for (int i = 1; i <= GrDrawState::kLastPublicStateBit; i <<= 1) { | 331 for (int i = 1; i <= GrDrawState::kLast_StateBit; i <<= 1) { |
332 state |= random->nextBool() * i; | 332 state |= random->nextBool() * i; |
333 } | 333 } |
334 gpu->drawState()->enableState(state); | 334 gpu->drawState()->enableState(state); |
335 } | 335 } |
336 | 336 |
337 // this function will randomly pick non-self referencing blend modes | 337 // this function will randomly pick non-self referencing blend modes |
338 static void set_random_blend_func(GrGpuGL* gpu, SkRandom* random) { | 338 static void set_random_blend_func(GrGpuGL* gpu, SkRandom* random) { |
339 GrBlendCoeff src; | 339 GrBlendCoeff src; |
340 do { | 340 do { |
341 src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub
licGrBlendCoeff)); | 341 src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub
licGrBlendCoeff)); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 if (type == GrContextFactory::kANGLE_GLContextType) { | 506 if (type == GrContextFactory::kANGLE_GLContextType) { |
507 maxStages = 3; | 507 maxStages = 3; |
508 } | 508 } |
509 #endif | 509 #endif |
510 REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages)); | 510 REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages)); |
511 } | 511 } |
512 } | 512 } |
513 } | 513 } |
514 | 514 |
515 #endif | 515 #endif |
OLD | NEW |