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

Side by Side Diff: src/effects/SkDisplacementMapEffect.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/SkDiscretePathEffect.cpp ('k') | src/effects/SkLightingImageFilter.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 2013 Google Inc. 2 * Copyright 2013 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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 #include "SkFlattenableBuffers.h" 9 #include "SkFlattenableBuffers.h"
10 #include "SkUnPreMultiply.h" 10 #include "SkUnPreMultiply.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 // and no displacement offset push any texture coordinates out of bounds OR if the constant 359 // and no displacement offset push any texture coordinates out of bounds OR if the constant
360 // alpha is 0. Since this isn't trivial to compute at this point, let's assu me the output is 360 // alpha is 0. Since this isn't trivial to compute at this point, let's assu me the output is
361 // not of constant color when a displacement effect is applied. 361 // not of constant color when a displacement effect is applied.
362 *validFlags = 0; 362 *validFlags = 0;
363 } 363 }
364 364
365 /////////////////////////////////////////////////////////////////////////////// 365 ///////////////////////////////////////////////////////////////////////////////
366 366
367 GR_DEFINE_EFFECT_TEST(GrDisplacementMapEffect); 367 GR_DEFINE_EFFECT_TEST(GrDisplacementMapEffect);
368 368
369 GrEffectRef* GrDisplacementMapEffect::TestCreate(SkMWCRandom* random, 369 GrEffectRef* GrDisplacementMapEffect::TestCreate(SkRandom* random,
370 GrContext*, 370 GrContext*,
371 const GrDrawTargetCaps&, 371 const GrDrawTargetCaps&,
372 GrTexture* textures[]) { 372 GrTexture* textures[]) {
373 int texIdxDispl = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 373 int texIdxDispl = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
374 GrEffectUnitTest::kAlphaTextureIdx; 374 GrEffectUnitTest::kAlphaTextureIdx;
375 int texIdxColor = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 375 int texIdxColor = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
376 GrEffectUnitTest::kAlphaTextureIdx; 376 GrEffectUnitTest::kAlphaTextureIdx;
377 static const int kMaxComponent = 4; 377 static const int kMaxComponent = 4;
378 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector = 378 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector =
379 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( 379 static_cast<SkDisplacementMapEffect::ChannelSelectorType>(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 colorTex); 526 colorTex);
527 527
528 colorKey <<= GrGLEffectMatrix::kKeyBits; 528 colorKey <<= GrGLEffectMatrix::kKeyBits;
529 EffectKey xKey = displacementMap.xChannelSelector() << (2 * GrGLEffectMatrix ::kKeyBits); 529 EffectKey xKey = displacementMap.xChannelSelector() << (2 * GrGLEffectMatrix ::kKeyBits);
530 EffectKey yKey = displacementMap.yChannelSelector() << (2 * GrGLEffectMatrix ::kKeyBits + 530 EffectKey yKey = displacementMap.yChannelSelector() << (2 * GrGLEffectMatrix ::kKeyBits +
531 SkDisplacementMapEff ect::kKeyBits); 531 SkDisplacementMapEff ect::kKeyBits);
532 532
533 return xKey | yKey | displKey | colorKey; 533 return xKey | yKey | displKey | colorKey;
534 } 534 }
535 #endif 535 #endif
OLDNEW
« no previous file with comments | « src/effects/SkDiscretePathEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698