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

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

Issue 22418006: effects: Replaces uses of GrAssert with SkASSERT. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 m.coordsType(), 370 m.coordsType(),
371 m.texture(0)); 371 m.texture(0));
372 return key | matrixKey; 372 return key | matrixKey;
373 } 373 }
374 374
375 void GrGLMorphologyEffect::setData(const GrGLUniformManager& uman, 375 void GrGLMorphologyEffect::setData(const GrGLUniformManager& uman,
376 const GrDrawEffect& drawEffect) { 376 const GrDrawEffect& drawEffect) {
377 const Gr1DKernelEffect& kern = drawEffect.castEffect<Gr1DKernelEffect>(); 377 const Gr1DKernelEffect& kern = drawEffect.castEffect<Gr1DKernelEffect>();
378 GrTexture& texture = *kern.texture(0); 378 GrTexture& texture = *kern.texture(0);
379 // the code we generated was for a specific kernel radius 379 // the code we generated was for a specific kernel radius
380 GrAssert(kern.radius() == fRadius); 380 SkASSERT(kern.radius() == fRadius);
381 float imageIncrement[2] = { 0 }; 381 float imageIncrement[2] = { 0 };
382 switch (kern.direction()) { 382 switch (kern.direction()) {
383 case Gr1DKernelEffect::kX_Direction: 383 case Gr1DKernelEffect::kX_Direction:
384 imageIncrement[0] = 1.0f / texture.width(); 384 imageIncrement[0] = 1.0f / texture.width();
385 break; 385 break;
386 case Gr1DKernelEffect::kY_Direction: 386 case Gr1DKernelEffect::kY_Direction:
387 imageIncrement[1] = 1.0f / texture.height(); 387 imageIncrement[1] = 1.0f / texture.height();
388 break; 388 break;
389 default: 389 default:
390 GrCrash("Unknown filter direction."); 390 GrCrash("Unknown filter direction.");
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 524 }
525 GrTexture* input = inputBM.getTexture(); 525 GrTexture* input = inputBM.getTexture();
526 SkIRect bounds; 526 SkIRect bounds;
527 src.getBounds(&bounds); 527 src.getBounds(&bounds);
528 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds, 528 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
529 GrMorphologyEffect::kErode_MorphologyType, radius())); 529 GrMorphologyEffect::kErode_MorphologyType, radius()));
530 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result); 530 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result);
531 } 531 }
532 532
533 #endif 533 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698