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