OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorMatrixFilter.h" | 8 #include "SkColorMatrixFilter.h" |
9 #include "SkColorMatrix.h" | 9 #include "SkColorMatrix.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorMatrixEffect); | 531 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorMatrixEffect); |
532 | 532 |
533 const GrFragmentProcessor* ColorMatrixEffect::TestCreate(GrProcessorTestData* d)
{ | 533 const GrFragmentProcessor* ColorMatrixEffect::TestCreate(GrProcessorTestData* d)
{ |
534 SkColorMatrix colorMatrix; | 534 SkColorMatrix colorMatrix; |
535 for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) { | 535 for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) { |
536 colorMatrix.fMat[i] = d->fRandom->nextSScalar1(); | 536 colorMatrix.fMat[i] = d->fRandom->nextSScalar1(); |
537 } | 537 } |
538 return ColorMatrixEffect::Create(colorMatrix); | 538 return ColorMatrixEffect::Create(colorMatrix); |
539 } | 539 } |
540 | 540 |
541 const GrFragmentProcessor* SkColorMatrixFilter::asFragmentProcessor(GrContext*)
const { | 541 const GrFragmentProcessor* SkColorMatrixFilter::asFragmentProcessor(GrContext*, |
| 542 GrRenderTarg
et* dst) const { |
542 return ColorMatrixEffect::Create(fMatrix); | 543 return ColorMatrixEffect::Create(fMatrix); |
543 } | 544 } |
544 | 545 |
545 #endif | 546 #endif |
546 | 547 |
547 #ifndef SK_IGNORE_TO_STRING | 548 #ifndef SK_IGNORE_TO_STRING |
548 void SkColorMatrixFilter::toString(SkString* str) const { | 549 void SkColorMatrixFilter::toString(SkString* str) const { |
549 str->append("SkColorMatrixFilter: "); | 550 str->append("SkColorMatrixFilter: "); |
550 | 551 |
551 str->append("matrix: ("); | 552 str->append("matrix: ("); |
552 for (int i = 0; i < 20; ++i) { | 553 for (int i = 0; i < 20; ++i) { |
553 str->appendScalar(fMatrix.fMat[i]); | 554 str->appendScalar(fMatrix.fMat[i]); |
554 if (i < 19) { | 555 if (i < 19) { |
555 str->append(", "); | 556 str->append(", "); |
556 } | 557 } |
557 } | 558 } |
558 str->append(")"); | 559 str->append(")"); |
559 } | 560 } |
560 #endif | 561 #endif |
OLD | NEW |