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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 static GrFragmentProcessor* Create(GrContext* ctx, | 489 static GrFragmentProcessor* Create(GrContext* ctx, |
490 const SkLinearGradient& shader, | 490 const SkLinearGradient& shader, |
491 const SkMatrix& matrix, | 491 const SkMatrix& matrix, |
492 SkShader::TileMode tm) { | 492 SkShader::TileMode tm) { |
493 return SkNEW_ARGS(GrLinearGradient, (ctx, shader, matrix, tm)); | 493 return SkNEW_ARGS(GrLinearGradient, (ctx, shader, matrix, tm)); |
494 } | 494 } |
495 | 495 |
496 virtual ~GrLinearGradient() { } | 496 virtual ~GrLinearGradient() { } |
497 | 497 |
498 virtual const char* name() const SK_OVERRIDE { return "Linear Gradient"; } | 498 const char* name() const SK_OVERRIDE { return "Linear Gradient"; } |
499 | 499 |
500 virtual void getGLProcessorKey(const GrGLCaps& caps, | 500 virtual void getGLProcessorKey(const GrGLCaps& caps, |
501 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 501 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
502 GrGLLinearGradient::GenKey(*this, caps, b); | 502 GrGLLinearGradient::GenKey(*this, caps, b); |
503 } | 503 } |
504 | 504 |
505 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE { | 505 GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE { |
506 return SkNEW_ARGS(GrGLLinearGradient, (*this)); | 506 return SkNEW_ARGS(GrGLLinearGradient, (*this)); |
507 } | 507 } |
508 | 508 |
509 private: | 509 private: |
510 GrLinearGradient(GrContext* ctx, | 510 GrLinearGradient(GrContext* ctx, |
511 const SkLinearGradient& shader, | 511 const SkLinearGradient& shader, |
512 const SkMatrix& matrix, | 512 const SkMatrix& matrix, |
513 SkShader::TileMode tm) | 513 SkShader::TileMode tm) |
514 : INHERITED(ctx, shader, matrix, tm) { | 514 : INHERITED(ctx, shader, matrix, tm) { |
515 this->initClassID<GrLinearGradient>(); | 515 this->initClassID<GrLinearGradient>(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 str->append("SkLinearGradient ("); | 604 str->append("SkLinearGradient ("); |
605 | 605 |
606 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 606 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
607 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 607 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
608 | 608 |
609 this->INHERITED::toString(str); | 609 this->INHERITED::toString(str); |
610 | 610 |
611 str->append(")"); | 611 str->append(")"); |
612 } | 612 } |
613 #endif | 613 #endif |
OLD | NEW |