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

Side by Side Diff: src/effects/SkMorphologyImageFilter.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/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.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 "SkMorphologyImageFilter.h" 8 #include "SkMorphologyImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 void GrMorphologyEffect::getConstantColorComponents(GrColor* color, uint32_t* va lidFlags) const { 420 void GrMorphologyEffect::getConstantColorComponents(GrColor* color, uint32_t* va lidFlags) const {
421 // This is valid because the color components of the result of the kernel al l come 421 // This is valid because the color components of the result of the kernel al l come
422 // exactly from existing values in the source texture. 422 // exactly from existing values in the source texture.
423 this->updateConstantColorComponentsForModulation(color, validFlags); 423 this->updateConstantColorComponentsForModulation(color, validFlags);
424 } 424 }
425 425
426 /////////////////////////////////////////////////////////////////////////////// 426 ///////////////////////////////////////////////////////////////////////////////
427 427
428 GR_DEFINE_EFFECT_TEST(GrMorphologyEffect); 428 GR_DEFINE_EFFECT_TEST(GrMorphologyEffect);
429 429
430 GrEffectRef* GrMorphologyEffect::TestCreate(SkMWCRandom* random, 430 GrEffectRef* GrMorphologyEffect::TestCreate(SkRandom* random,
431 GrContext*, 431 GrContext*,
432 const GrDrawTargetCaps&, 432 const GrDrawTargetCaps&,
433 GrTexture* textures[]) { 433 GrTexture* textures[]) {
434 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 434 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
435 GrEffectUnitTest::kAlphaTextureIdx; 435 GrEffectUnitTest::kAlphaTextureIdx;
436 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; 436 Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
437 static const int kMaxRadius = 10; 437 static const int kMaxRadius = 10;
438 int radius = random->nextRangeU(1, kMaxRadius); 438 int radius = random->nextRangeU(1, kMaxRadius);
439 MorphologyType type = random->nextBool() ? GrMorphologyEffect::kErode_Morpho logyType : 439 MorphologyType type = random->nextBool() ? GrMorphologyEffect::kErode_Morpho logyType :
440 GrMorphologyEffect::kDilate_Morph ologyType; 440 GrMorphologyEffect::kDilate_Morph ologyType;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 523 }
524 GrTexture* input = inputBM.getTexture(); 524 GrTexture* input = inputBM.getTexture();
525 SkIRect bounds; 525 SkIRect bounds;
526 src.getBounds(&bounds); 526 src.getBounds(&bounds);
527 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds, 527 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
528 GrMorphologyEffect::kErode_MorphologyType, radius())); 528 GrMorphologyEffect::kErode_MorphologyType, radius()));
529 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result); 529 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result);
530 } 530 }
531 531
532 #endif 532 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698