Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698