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