OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkMatrixConvolutionImageFilter.h" | 8 #include "SkMatrixConvolutionImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 fTileMode == s.tileMode() && | 523 fTileMode == s.tileMode() && |
524 fConvolveAlpha == s.convolveAlpha(); | 524 fConvolveAlpha == s.convolveAlpha(); |
525 } | 525 } |
526 | 526 |
527 GR_DEFINE_EFFECT_TEST(GrMatrixConvolutionEffect); | 527 GR_DEFINE_EFFECT_TEST(GrMatrixConvolutionEffect); |
528 | 528 |
529 // A little bit less than the minimum # uniforms required by DX9SM2 (32). | 529 // A little bit less than the minimum # uniforms required by DX9SM2 (32). |
530 // Allows for a 5x5 kernel (or 25x1, for that matter). | 530 // Allows for a 5x5 kernel (or 25x1, for that matter). |
531 #define MAX_KERNEL_SIZE 25 | 531 #define MAX_KERNEL_SIZE 25 |
532 | 532 |
533 GrEffectRef* GrMatrixConvolutionEffect::TestCreate(SkMWCRandom* random, | 533 GrEffectRef* GrMatrixConvolutionEffect::TestCreate(SkRandom* random, |
534 GrContext* context, | 534 GrContext* context, |
535 const GrDrawTargetCaps&, | 535 const GrDrawTargetCaps&, |
536 GrTexture* textures[]) { | 536 GrTexture* textures[]) { |
537 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 537 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
538 GrEffectUnitTest::kAlphaTextureIdx; | 538 GrEffectUnitTest::kAlphaTextureIdx; |
539 int width = random->nextRangeU(1, MAX_KERNEL_SIZE); | 539 int width = random->nextRangeU(1, MAX_KERNEL_SIZE); |
540 int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width); | 540 int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width); |
541 SkISize kernelSize = SkISize::Make(width, height); | 541 SkISize kernelSize = SkISize::Make(width, height); |
542 SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]); | 542 SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]); |
543 for (int i = 0; i < width * height; i++) { | 543 for (int i = 0; i < width * height; i++) { |
(...skipping 29 matching lines...) Expand all Loading... |
573 fBias, | 573 fBias, |
574 fTarget, | 574 fTarget, |
575 fTileMode, | 575 fTileMode, |
576 fConvolveAlpha); | 576 fConvolveAlpha); |
577 return true; | 577 return true; |
578 } | 578 } |
579 | 579 |
580 /////////////////////////////////////////////////////////////////////////////// | 580 /////////////////////////////////////////////////////////////////////////////// |
581 | 581 |
582 #endif | 582 #endif |
OLD | NEW |