| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkLinearGradient.h" | 8 #include "SkLinearGradient.h" |
| 9 | 9 |
| 10 static inline int repeat_bits(int x, const int bits) { | 10 static inline int repeat_bits(int x, const int bits) { |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 520 |
| 521 typedef GrGradientEffect INHERITED; | 521 typedef GrGradientEffect INHERITED; |
| 522 }; | 522 }; |
| 523 | 523 |
| 524 ///////////////////////////////////////////////////////////////////// | 524 ///////////////////////////////////////////////////////////////////// |
| 525 | 525 |
| 526 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrLinearGradient); | 526 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrLinearGradient); |
| 527 | 527 |
| 528 GrFragmentProcessor* GrLinearGradient::TestCreate(SkRandom* random, | 528 GrFragmentProcessor* GrLinearGradient::TestCreate(SkRandom* random, |
| 529 GrContext* context, | 529 GrContext* context, |
| 530 const GrDrawTargetCaps&, | 530 const GrCaps&, |
| 531 GrTexture**) { | 531 GrTexture**) { |
| 532 SkPoint points[] = {{random->nextUScalar1(), random->nextUScalar1()}, | 532 SkPoint points[] = {{random->nextUScalar1(), random->nextUScalar1()}, |
| 533 {random->nextUScalar1(), random->nextUScalar1()}}; | 533 {random->nextUScalar1(), random->nextUScalar1()}}; |
| 534 | 534 |
| 535 SkColor colors[kMaxRandomGradientColors]; | 535 SkColor colors[kMaxRandomGradientColors]; |
| 536 SkScalar stopsArray[kMaxRandomGradientColors]; | 536 SkScalar stopsArray[kMaxRandomGradientColors]; |
| 537 SkScalar* stops = stopsArray; | 537 SkScalar* stops = stopsArray; |
| 538 SkShader::TileMode tm; | 538 SkShader::TileMode tm; |
| 539 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 539 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
| 540 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, | 540 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 str->append("SkLinearGradient ("); | 606 str->append("SkLinearGradient ("); |
| 607 | 607 |
| 608 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 608 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
| 609 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 609 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
| 610 | 610 |
| 611 this->INHERITED::toString(str); | 611 this->INHERITED::toString(str); |
| 612 | 612 |
| 613 str->append(")"); | 613 str->append(")"); |
| 614 } | 614 } |
| 615 #endif | 615 #endif |
| OLD | NEW |