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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 387 |
388 #if SK_SUPPORT_GPU | 388 #if SK_SUPPORT_GPU |
389 | 389 |
390 #include "SkGr.h" | 390 #include "SkGr.h" |
391 | 391 |
392 bool SkTwoPointConicalGradient::asFragmentProcessor(GrContext* context, | 392 bool SkTwoPointConicalGradient::asFragmentProcessor(GrContext* context, |
393 const SkPaint& paint, | 393 const SkPaint& paint, |
394 const SkMatrix& viewM, | 394 const SkMatrix& viewM, |
395 const SkMatrix* localMatrix, | 395 const SkMatrix* localMatrix, |
396 GrColor* paintColor, | 396 GrColor* paintColor, |
397 GrShaderDataManager* shaderD
ataManager, | 397 GrProcessorDataManager* proc
DataManager, |
398 GrFragmentProcessor** fp) c
onst { | 398 GrFragmentProcessor** fp) c
onst { |
399 SkASSERT(context); | 399 SkASSERT(context); |
400 SkASSERT(fPtsToUnit.isIdentity()); | 400 SkASSERT(fPtsToUnit.isIdentity()); |
401 | 401 |
402 *fp = Gr2PtConicalGradientEffect::Create(context, shaderDataManager, *this,
fTileMode, | 402 *fp = Gr2PtConicalGradientEffect::Create(context, procDataManager, *this, fT
ileMode, |
403 localMatrix); | 403 localMatrix); |
404 *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); | 404 *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); |
405 return true; | 405 return true; |
406 } | 406 } |
407 | 407 |
408 #else | 408 #else |
409 | 409 |
410 bool SkTwoPointConicalGradient::asFragmentProcessor(GrContext*, const SkPaint&, | 410 bool SkTwoPointConicalGradient::asFragmentProcessor(GrContext*, const SkPaint&, |
411 const SkMatrix&, const SkMat
rix*, | 411 const SkMatrix&, const SkMat
rix*, |
412 GrColor*, GrShaderDataManage
r*, | 412 GrColor*, GrProcessorDataMan
ager*, |
413 GrFragmentProcessor**) cons
t { | 413 GrFragmentProcessor**) cons
t { |
414 SkDEBUGFAIL("Should not call in GPU-less build"); | 414 SkDEBUGFAIL("Should not call in GPU-less build"); |
415 return false; | 415 return false; |
416 } | 416 } |
417 | 417 |
418 #endif | 418 #endif |
419 | 419 |
420 #ifndef SK_IGNORE_TO_STRING | 420 #ifndef SK_IGNORE_TO_STRING |
421 void SkTwoPointConicalGradient::toString(SkString* str) const { | 421 void SkTwoPointConicalGradient::toString(SkString* str) const { |
422 str->append("SkTwoPointConicalGradient: ("); | 422 str->append("SkTwoPointConicalGradient: ("); |
(...skipping 12 matching lines...) Expand all Loading... |
435 str->appendScalar(fCenter2.fY); | 435 str->appendScalar(fCenter2.fY); |
436 str->append(") radius2: "); | 436 str->append(") radius2: "); |
437 str->appendScalar(fRadius2); | 437 str->appendScalar(fRadius2); |
438 str->append(" "); | 438 str->append(" "); |
439 | 439 |
440 this->INHERITED::toString(str); | 440 this->INHERITED::toString(str); |
441 | 441 |
442 str->append(")"); | 442 str->append(")"); |
443 } | 443 } |
444 #endif | 444 #endif |
OLD | NEW |