| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 *grColor = SkColor2GrColorJustAlpha(paint.getColor()); | 572 *grColor = SkColor2GrColorJustAlpha(paint.getColor()); |
| 573 *grEffect = GrLinearGradient::Create(context, *this, matrix, fTileMode); | 573 *grEffect = GrLinearGradient::Create(context, *this, matrix, fTileMode); |
| 574 | 574 |
| 575 return true; | 575 return true; |
| 576 } | 576 } |
| 577 | 577 |
| 578 #else | 578 #else |
| 579 | 579 |
| 580 bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint, | 580 bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint, |
| 581 const SkMatrix* localMatrix, GrColor* grColor
, | 581 const SkMatrix* localMatrix, GrColor* grColor
, |
| 582 GrEffect** grEffect) const { | 582 GrEffectRef** grEffect) const { |
| 583 SkDEBUGFAIL("Should not call in GPU-less build"); | 583 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 584 return false; | 584 return false; |
| 585 } | 585 } |
| 586 | 586 |
| 587 #endif | 587 #endif |
| 588 | 588 |
| 589 #ifndef SK_IGNORE_TO_STRING | 589 #ifndef SK_IGNORE_TO_STRING |
| 590 void SkLinearGradient::toString(SkString* str) const { | 590 void SkLinearGradient::toString(SkString* str) const { |
| 591 str->append("SkLinearGradient ("); | 591 str->append("SkLinearGradient ("); |
| 592 | 592 |
| 593 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 593 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
| 594 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 594 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
| 595 | 595 |
| 596 this->INHERITED::toString(str); | 596 this->INHERITED::toString(str); |
| 597 | 597 |
| 598 str->append(")"); | 598 str->append(")"); |
| 599 } | 599 } |
| 600 #endif | 600 #endif |
| OLD | NEW |