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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 buffer.writePoint(fCenter2); | 349 buffer.writePoint(fCenter2); |
350 buffer.writeScalar(fRadius1); | 350 buffer.writeScalar(fRadius1); |
351 buffer.writeScalar(fRadius2); | 351 buffer.writeScalar(fRadius2); |
352 buffer.writeBool(fFlippedGrad); | 352 buffer.writeBool(fFlippedGrad); |
353 } | 353 } |
354 | 354 |
355 #if SK_SUPPORT_GPU | 355 #if SK_SUPPORT_GPU |
356 | 356 |
357 #include "SkGr.h" | 357 #include "SkGr.h" |
358 | 358 |
359 const GrFragmentProcessor* SkTwoPointConicalGradient::asFragmentProcessor( | 359 sk_sp<GrFragmentProcessor> SkTwoPointConicalGradient::asFragmentProcessor( |
360 GrContext* context, | 360 GrContext* context, |
361 const SkMatrix& viewM, | 361 const SkMatrix& viewM, |
362 const SkMatrix* localMatrix, | 362 const SkMatrix* localMatrix, |
363 SkFilterQuality, | 363 SkFilterQuality, |
364 SkSourceGammaTreatment) const
{ | 364 SkSourceGammaTreatment) const
{ |
365 SkASSERT(context); | 365 SkASSERT(context); |
366 SkASSERT(fPtsToUnit.isIdentity()); | 366 SkASSERT(fPtsToUnit.isIdentity()); |
367 SkAutoTUnref<const GrFragmentProcessor> inner( | 367 sk_sp<GrFragmentProcessor> inner( |
368 Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, localMatri
x)); | 368 Gr2PtConicalGradientEffect::Make(context, *this, fTileMode, localMatrix)
); |
369 return GrFragmentProcessor::MulOutputByInputAlpha(inner); | 369 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); |
370 } | 370 } |
371 | 371 |
372 #endif | 372 #endif |
373 | 373 |
374 #ifndef SK_IGNORE_TO_STRING | 374 #ifndef SK_IGNORE_TO_STRING |
375 void SkTwoPointConicalGradient::toString(SkString* str) const { | 375 void SkTwoPointConicalGradient::toString(SkString* str) const { |
376 str->append("SkTwoPointConicalGradient: ("); | 376 str->append("SkTwoPointConicalGradient: ("); |
377 | 377 |
378 str->append("center1: ("); | 378 str->append("center1: ("); |
379 str->appendScalar(fCenter1.fX); | 379 str->appendScalar(fCenter1.fX); |
380 str->append(", "); | 380 str->append(", "); |
381 str->appendScalar(fCenter1.fY); | 381 str->appendScalar(fCenter1.fY); |
382 str->append(") radius1: "); | 382 str->append(") radius1: "); |
383 str->appendScalar(fRadius1); | 383 str->appendScalar(fRadius1); |
384 str->append(" "); | 384 str->append(" "); |
385 | 385 |
386 str->append("center2: ("); | 386 str->append("center2: ("); |
387 str->appendScalar(fCenter2.fX); | 387 str->appendScalar(fCenter2.fX); |
388 str->append(", "); | 388 str->append(", "); |
389 str->appendScalar(fCenter2.fY); | 389 str->appendScalar(fCenter2.fY); |
390 str->append(") radius2: "); | 390 str->append(") radius2: "); |
391 str->appendScalar(fRadius2); | 391 str->appendScalar(fRadius2); |
392 str->append(" "); | 392 str->append(" "); |
393 | 393 |
394 this->INHERITED::toString(str); | 394 this->INHERITED::toString(str); |
395 | 395 |
396 str->append(")"); | 396 str->append(")"); |
397 } | 397 } |
398 #endif | 398 #endif |
OLD | NEW |