| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 private: | 481 private: |
| 482 GrLinearGradient(GrContext* ctx, | 482 GrLinearGradient(GrContext* ctx, |
| 483 const SkLinearGradient& shader, | 483 const SkLinearGradient& shader, |
| 484 const SkMatrix& matrix, | 484 const SkMatrix& matrix, |
| 485 SkShader::TileMode tm) | 485 SkShader::TileMode tm) |
| 486 : INHERITED(ctx, shader, matrix, tm) { | 486 : INHERITED(ctx, shader, matrix, tm) { |
| 487 this->initClassID<GrLinearGradient>(); | 487 this->initClassID<GrLinearGradient>(); |
| 488 } | 488 } |
| 489 | 489 |
| 490 GrGLSLFragmentProcessor* onCreateGLInstance() const override { | 490 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { |
| 491 return new GrGLLinearGradient(*this); | 491 return new GrGLLinearGradient(*this); |
| 492 } | 492 } |
| 493 | 493 |
| 494 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, | 494 virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
| 495 GrProcessorKeyBuilder* b) const override { | 495 GrProcessorKeyBuilder* b) const override
{ |
| 496 GrGLLinearGradient::GenKey(*this, caps, b); | 496 GrGLLinearGradient::GenKey(*this, caps, b); |
| 497 } | 497 } |
| 498 | 498 |
| 499 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 499 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 500 | 500 |
| 501 typedef GrGradientEffect INHERITED; | 501 typedef GrGradientEffect INHERITED; |
| 502 }; | 502 }; |
| 503 | 503 |
| 504 ///////////////////////////////////////////////////////////////////// | 504 ///////////////////////////////////////////////////////////////////// |
| 505 | 505 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 str->append("SkLinearGradient ("); | 569 str->append("SkLinearGradient ("); |
| 570 | 570 |
| 571 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 571 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
| 572 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 572 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
| 573 | 573 |
| 574 this->INHERITED::toString(str); | 574 this->INHERITED::toString(str); |
| 575 | 575 |
| 576 str->append(")"); | 576 str->append(")"); |
| 577 } | 577 } |
| 578 #endif | 578 #endif |
| OLD | NEW |