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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 GrContext*, | 535 GrContext*, |
536 const GrCaps&, | 536 const GrCaps&, |
537 GrTexture* dummyTextures[2])
{ | 537 GrTexture* dummyTextures[2])
{ |
538 SkColorMatrix colorMatrix; | 538 SkColorMatrix colorMatrix; |
539 for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) { | 539 for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) { |
540 colorMatrix.fMat[i] = random->nextSScalar1(); | 540 colorMatrix.fMat[i] = random->nextSScalar1(); |
541 } | 541 } |
542 return ColorMatrixEffect::Create(colorMatrix); | 542 return ColorMatrixEffect::Create(colorMatrix); |
543 } | 543 } |
544 | 544 |
545 bool SkColorMatrixFilter::asFragmentProcessors(GrContext*, | 545 bool SkColorMatrixFilter::asFragmentProcessors(GrContext*, GrShaderDataManager*, |
546 SkTDArray<GrFragmentProcessor*>*
array) const { | 546 SkTDArray<GrFragmentProcessor*>*
array) const { |
547 GrFragmentProcessor* frag = ColorMatrixEffect::Create(fMatrix); | 547 GrFragmentProcessor* frag = ColorMatrixEffect::Create(fMatrix); |
548 if (frag) { | 548 if (frag) { |
549 if (array) { | 549 if (array) { |
550 *array->append() = frag; | 550 *array->append() = frag; |
551 } else { | 551 } else { |
552 frag->unref(); | 552 frag->unref(); |
553 SkDEBUGCODE(frag = NULL;) | 553 SkDEBUGCODE(frag = NULL;) |
554 } | 554 } |
555 return true; | 555 return true; |
(...skipping 10 matching lines...) Expand all Loading... |
566 str->append("matrix: ("); | 566 str->append("matrix: ("); |
567 for (int i = 0; i < 20; ++i) { | 567 for (int i = 0; i < 20; ++i) { |
568 str->appendScalar(fMatrix.fMat[i]); | 568 str->appendScalar(fMatrix.fMat[i]); |
569 if (i < 19) { | 569 if (i < 19) { |
570 str->append(", "); | 570 str->append(", "); |
571 } | 571 } |
572 } | 572 } |
573 str->append(")"); | 573 str->append(")"); |
574 } | 574 } |
575 #endif | 575 #endif |
OLD | NEW |