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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 buffer.writeScalar(fRadius1); | 375 buffer.writeScalar(fRadius1); |
376 buffer.writeScalar(fRadius2); | 376 buffer.writeScalar(fRadius2); |
377 buffer.writeBool(fFlippedGrad); | 377 buffer.writeBool(fFlippedGrad); |
378 } | 378 } |
379 | 379 |
380 #if SK_SUPPORT_GPU | 380 #if SK_SUPPORT_GPU |
381 | 381 |
382 #include "SkGr.h" | 382 #include "SkGr.h" |
383 | 383 |
384 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& p
aint, | 384 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& p
aint, |
385 const SkMatrix* localMatrix, GrColo
r* grColor, | 385 const SkMatrix* localMatrix, GrColo
r* paintColor, |
386 GrEffectRef** grEffect) const { | 386 GrEffect** effect) const { |
387 SkASSERT(NULL != context); | 387 SkASSERT(NULL != context); |
388 SkASSERT(fPtsToUnit.isIdentity()); | 388 SkASSERT(fPtsToUnit.isIdentity()); |
389 | 389 |
390 *grEffect = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, lo
calMatrix); | 390 *effect = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, loca
lMatrix); |
391 *grColor = SkColor2GrColorJustAlpha(paint.getColor()); | 391 *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); |
392 return true; | 392 return true; |
393 } | 393 } |
394 | 394 |
395 #else | 395 #else |
396 | 396 |
397 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& p
aint, | 397 bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& p
aint, |
398 const SkMatrix* localMatrix, GrColor
* grColor, | 398 const SkMatrix* localMatrix, GrColor
* paintColor, |
399 GrEffect** grEffect) const { | 399 GrEffect** effect) const { |
400 SkDEBUGFAIL("Should not call in GPU-less build"); | 400 SkDEBUGFAIL("Should not call in GPU-less build"); |
401 return false; | 401 return false; |
402 } | 402 } |
403 | 403 |
404 #endif | 404 #endif |
405 | 405 |
406 #ifndef SK_IGNORE_TO_STRING | 406 #ifndef SK_IGNORE_TO_STRING |
407 void SkTwoPointConicalGradient::toString(SkString* str) const { | 407 void SkTwoPointConicalGradient::toString(SkString* str) const { |
408 str->append("SkTwoPointConicalGradient: ("); | 408 str->append("SkTwoPointConicalGradient: ("); |
409 | 409 |
(...skipping 11 matching lines...) Expand all Loading... |
421 str->appendScalar(fCenter2.fY); | 421 str->appendScalar(fCenter2.fY); |
422 str->append(") radius2: "); | 422 str->append(") radius2: "); |
423 str->appendScalar(fRadius2); | 423 str->appendScalar(fRadius2); |
424 str->append(" "); | 424 str->append(" "); |
425 | 425 |
426 this->INHERITED::toString(str); | 426 this->INHERITED::toString(str); |
427 | 427 |
428 str->append(")"); | 428 str->append(")"); |
429 } | 429 } |
430 #endif | 430 #endif |
OLD | NEW |