| OLD | NEW |
| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 // exactly from existing values in the source texture. | 537 // exactly from existing values in the source texture. |
| 538 this->updateInvariantOutputForModulation(inout); | 538 this->updateInvariantOutputForModulation(inout); |
| 539 } | 539 } |
| 540 | 540 |
| 541 /////////////////////////////////////////////////////////////////////////////// | 541 /////////////////////////////////////////////////////////////////////////////// |
| 542 | 542 |
| 543 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMorphologyEffect); | 543 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMorphologyEffect); |
| 544 | 544 |
| 545 GrFragmentProcessor* GrMorphologyEffect::TestCreate(SkRandom* random, | 545 GrFragmentProcessor* GrMorphologyEffect::TestCreate(SkRandom* random, |
| 546 GrContext*, | 546 GrContext*, |
| 547 const GrDrawTargetCaps&, | 547 const GrCaps&, |
| 548 GrTexture* textures[]) { | 548 GrTexture* textures[]) { |
| 549 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : | 549 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : |
| 550 GrProcessorUnitTest::kAlphaTextureIdx; | 550 GrProcessorUnitTest::kAlphaTextureIdx; |
| 551 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; | 551 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; |
| 552 static const int kMaxRadius = 10; | 552 static const int kMaxRadius = 10; |
| 553 int radius = random->nextRangeU(1, kMaxRadius); | 553 int radius = random->nextRangeU(1, kMaxRadius); |
| 554 MorphologyType type = random->nextBool() ? GrMorphologyEffect::kErode_Morpho
logyType : | 554 MorphologyType type = random->nextBool() ? GrMorphologyEffect::kErode_Morpho
logyType : |
| 555 GrMorphologyEffect::kDilate_Morph
ologyType; | 555 GrMorphologyEffect::kDilate_Morph
ologyType; |
| 556 | 556 |
| 557 return GrMorphologyEffect::Create(textures[texIdx], dir, radius, type); | 557 return GrMorphologyEffect::Create(textures[texIdx], dir, radius, type); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 SkBitmap* result, SkIPoint* offset) con
st { | 749 SkBitmap* result, SkIPoint* offset) con
st { |
| 750 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 750 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
| 751 } | 751 } |
| 752 | 752 |
| 753 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 753 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 754 SkBitmap* result, SkIPoint* offset) cons
t { | 754 SkBitmap* result, SkIPoint* offset) cons
t { |
| 755 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 755 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
| 756 } | 756 } |
| 757 | 757 |
| 758 #endif | 758 #endif |
| OLD | NEW |