| 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 "SkTwoPointConicalGradient.h" | 8 #include "SkTwoPointConicalGradient.h" |
| 9 #include "SkTwoPointConicalGradient_gpu.h" | 9 #include "SkTwoPointConicalGradient_gpu.h" |
| 10 | 10 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 buffer.writePoint(fCenter2); | 413 buffer.writePoint(fCenter2); |
| 414 buffer.writeScalar(fRadius1); | 414 buffer.writeScalar(fRadius1); |
| 415 buffer.writeScalar(fRadius2); | 415 buffer.writeScalar(fRadius2); |
| 416 buffer.writeBool(fFlippedGrad); | 416 buffer.writeBool(fFlippedGrad); |
| 417 } | 417 } |
| 418 | 418 |
| 419 #if SK_SUPPORT_GPU | 419 #if SK_SUPPORT_GPU |
| 420 | 420 |
| 421 #include "SkGr.h" | 421 #include "SkGr.h" |
| 422 | 422 |
| 423 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& p
aint, | 423 bool SkTwoPointConicalGradient::asFragmentProcessor(GrContext* context, |
| 424 const SkMatrix* localMatrix, GrColo
r* paintColor, | 424 const SkPaint& paint, |
| 425 GrEffect** effect) const { | 425 const SkMatrix* localMatrix, |
| 426 GrColor* paintColor, |
| 427 GrFragmentProcessor** fp) c
onst { |
| 426 SkASSERT(context); | 428 SkASSERT(context); |
| 427 SkASSERT(fPtsToUnit.isIdentity()); | 429 SkASSERT(fPtsToUnit.isIdentity()); |
| 428 | 430 |
| 429 *effect = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, loca
lMatrix); | 431 *fp = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, localMat
rix); |
| 430 *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); | 432 *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); |
| 431 return true; | 433 return true; |
| 432 } | 434 } |
| 433 | 435 |
| 434 #else | 436 #else |
| 435 | 437 |
| 436 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& p
aint, | 438 bool SkTwoPointConicalGradient::asFragmentProcessor(GrContext*, const SkPaint&,
const SkMatrix*, |
| 437 const SkMatrix* localMatrix, GrColor
* paintColor, | 439 GrColor*, GrFragmentProcesso
r**) const { |
| 438 GrEffect** effect) const { | |
| 439 SkDEBUGFAIL("Should not call in GPU-less build"); | 440 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 440 return false; | 441 return false; |
| 441 } | 442 } |
| 442 | 443 |
| 443 #endif | 444 #endif |
| 444 | 445 |
| 445 #ifndef SK_IGNORE_TO_STRING | 446 #ifndef SK_IGNORE_TO_STRING |
| 446 void SkTwoPointConicalGradient::toString(SkString* str) const { | 447 void SkTwoPointConicalGradient::toString(SkString* str) const { |
| 447 str->append("SkTwoPointConicalGradient: ("); | 448 str->append("SkTwoPointConicalGradient: ("); |
| 448 | 449 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 460 str->appendScalar(fCenter2.fY); | 461 str->appendScalar(fCenter2.fY); |
| 461 str->append(") radius2: "); | 462 str->append(") radius2: "); |
| 462 str->appendScalar(fRadius2); | 463 str->appendScalar(fRadius2); |
| 463 str->append(" "); | 464 str->append(" "); |
| 464 | 465 |
| 465 this->INHERITED::toString(str); | 466 this->INHERITED::toString(str); |
| 466 | 467 |
| 467 str->append(")"); | 468 str->append(")"); |
| 468 } | 469 } |
| 469 #endif | 470 #endif |
| OLD | NEW |