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

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

Issue 12965018: Move nested class GrDrawTarget::Caps out as GrDrawTargetCaps. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 // exactly from existing values in the source texture. 416 // exactly from existing values in the source texture.
417 this->updateConstantColorComponentsForModulation(color, validFlags); 417 this->updateConstantColorComponentsForModulation(color, validFlags);
418 } 418 }
419 419
420 /////////////////////////////////////////////////////////////////////////////// 420 ///////////////////////////////////////////////////////////////////////////////
421 421
422 GR_DEFINE_EFFECT_TEST(GrMorphologyEffect); 422 GR_DEFINE_EFFECT_TEST(GrMorphologyEffect);
423 423
424 GrEffectRef* GrMorphologyEffect::TestCreate(SkMWCRandom* random, 424 GrEffectRef* GrMorphologyEffect::TestCreate(SkMWCRandom* random,
425 GrContext*, 425 GrContext*,
426 const GrDrawTargetCaps&,
426 GrTexture* textures[]) { 427 GrTexture* textures[]) {
427 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 428 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
428 GrEffectUnitTest::kAlphaTextureIdx; 429 GrEffectUnitTest::kAlphaTextureIdx;
429 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; 430 Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
430 static const int kMaxRadius = 10; 431 static const int kMaxRadius = 10;
431 int radius = random->nextRangeU(1, kMaxRadius); 432 int radius = random->nextRangeU(1, kMaxRadius);
432 MorphologyType type = random->nextBool() ? GrMorphologyEffect::kErode_Morpho logyType : 433 MorphologyType type = random->nextBool() ? GrMorphologyEffect::kErode_Morpho logyType :
433 GrMorphologyEffect::kDilate_Morph ologyType; 434 GrMorphologyEffect::kDilate_Morph ologyType;
434 435
435 return GrMorphologyEffect::Create(textures[texIdx], dir, radius, type); 436 return GrMorphologyEffect::Create(textures[texIdx], dir, radius, type);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 515 }
515 GrTexture* input = (GrTexture*) inputBM.getTexture(); 516 GrTexture* input = (GrTexture*) inputBM.getTexture();
516 SkIRect bounds; 517 SkIRect bounds;
517 src.getBounds(&bounds); 518 src.getBounds(&bounds);
518 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds, 519 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
519 GrMorphologyEffect::kErode_MorphologyType, radius())); 520 GrMorphologyEffect::kErode_MorphologyType, radius()));
520 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result); 521 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result);
521 } 522 }
522 523
523 #endif 524 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698