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

Side by Side Diff: src/effects/SkBitmapAlphaThresholdShader.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/SkArithmeticMode.cpp ('k') | src/effects/SkColorMatrixFilter.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 "SkBitmapAlphaThresholdShader.h" 8 #include "SkBitmapAlphaThresholdShader.h"
9 9
10 class BATShader : public SkShader { 10 class BATShader : public SkShader {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 GrTextureAccess fMaskAccess; 228 GrTextureAccess fMaskAccess;
229 229
230 SkMatrix fBmpMatrix; 230 SkMatrix fBmpMatrix;
231 SkMatrix fMaskMatrix; 231 SkMatrix fMaskMatrix;
232 232
233 SkScalar fThreshold; 233 SkScalar fThreshold;
234 }; 234 };
235 235
236 GR_DEFINE_EFFECT_TEST(ThresholdEffect); 236 GR_DEFINE_EFFECT_TEST(ThresholdEffect);
237 237
238 GrEffectRef* ThresholdEffect::TestCreate(SkMWCRandom* rand, 238 GrEffectRef* ThresholdEffect::TestCreate(SkRandom* rand,
239 GrContext*, 239 GrContext*,
240 const GrDrawTargetCaps&, 240 const GrDrawTargetCaps&,
241 GrTexture* textures[]) { 241 GrTexture* textures[]) {
242 GrTexture* bmpTex = textures[GrEffectUnitTest::kSkiaPMTextureIdx]; 242 GrTexture* bmpTex = textures[GrEffectUnitTest::kSkiaPMTextureIdx];
243 GrTexture* maskTex = textures[GrEffectUnitTest::kAlphaTextureIdx]; 243 GrTexture* maskTex = textures[GrEffectUnitTest::kAlphaTextureIdx];
244 U8CPU thresh = rand->nextU() % 0xff; 244 U8CPU thresh = rand->nextU() % 0xff;
245 return ThresholdEffect::Create(bmpTex, SkMatrix::I(), maskTex, SkMatrix::I() , thresh); 245 return ThresholdEffect::Create(bmpTex, SkMatrix::I(), maskTex, SkMatrix::I() , thresh);
246 } 246 }
247 247
248 GrEffectRef* BATShader::asNewEffect(GrContext* context, const SkPaint& paint) co nst { 248 GrEffectRef* BATShader::asNewEffect(GrContext* context, const SkPaint& paint) co nst {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 GrEffectRef* effect = ThresholdEffect::Create(bmpTexture, bmpMatrix, 302 GrEffectRef* effect = ThresholdEffect::Create(bmpTexture, bmpMatrix,
303 maskTexture, maskMatrix, 303 maskTexture, maskMatrix,
304 fThreshold); 304 fThreshold);
305 305
306 GrUnlockAndUnrefCachedBitmapTexture(bmpTexture); 306 GrUnlockAndUnrefCachedBitmapTexture(bmpTexture);
307 307
308 return effect; 308 return effect;
309 } 309 }
310 310
311 #endif 311 #endif
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698