| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 #include "SkLinearGradient.h" | 9 #include "SkLinearGradient.h" |
| 10 | 10 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 506 |
| 507 typedef GrGradientEffect INHERITED; | 507 typedef GrGradientEffect INHERITED; |
| 508 }; | 508 }; |
| 509 | 509 |
| 510 ///////////////////////////////////////////////////////////////////// | 510 ///////////////////////////////////////////////////////////////////// |
| 511 | 511 |
| 512 GR_DEFINE_EFFECT_TEST(GrLinearGradient); | 512 GR_DEFINE_EFFECT_TEST(GrLinearGradient); |
| 513 | 513 |
| 514 GrEffectRef* GrLinearGradient::TestCreate(SkMWCRandom* random, | 514 GrEffectRef* GrLinearGradient::TestCreate(SkMWCRandom* random, |
| 515 GrContext* context, | 515 GrContext* context, |
| 516 const GrDrawTargetCaps&, |
| 516 GrTexture**) { | 517 GrTexture**) { |
| 517 SkPoint points[] = {{random->nextUScalar1(), random->nextUScalar1()}, | 518 SkPoint points[] = {{random->nextUScalar1(), random->nextUScalar1()}, |
| 518 {random->nextUScalar1(), random->nextUScalar1()}}; | 519 {random->nextUScalar1(), random->nextUScalar1()}}; |
| 519 | 520 |
| 520 SkColor colors[kMaxRandomGradientColors]; | 521 SkColor colors[kMaxRandomGradientColors]; |
| 521 SkScalar stopsArray[kMaxRandomGradientColors]; | 522 SkScalar stopsArray[kMaxRandomGradientColors]; |
| 522 SkScalar* stops = stopsArray; | 523 SkScalar* stops = stopsArray; |
| 523 SkShader::TileMode tm; | 524 SkShader::TileMode tm; |
| 524 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 525 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
| 525 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, | 526 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 str->append("SkLinearGradient ("); | 573 str->append("SkLinearGradient ("); |
| 573 | 574 |
| 574 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 575 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
| 575 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 576 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
| 576 | 577 |
| 577 this->INHERITED::toString(str); | 578 this->INHERITED::toString(str); |
| 578 | 579 |
| 579 str->append(")"); | 580 str->append(")"); |
| 580 } | 581 } |
| 581 #endif | 582 #endif |
| OLD | NEW |