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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 void GrMorphologyEffect::onComputeInvariantOutput(GrInvariantOutput* inout) cons
t { | 438 void GrMorphologyEffect::onComputeInvariantOutput(GrInvariantOutput* inout) cons
t { |
439 // This is valid because the color components of the result of the kernel al
l come | 439 // This is valid because the color components of the result of the kernel al
l come |
440 // exactly from existing values in the source texture. | 440 // exactly from existing values in the source texture. |
441 this->updateInvariantOutputForModulation(inout); | 441 this->updateInvariantOutputForModulation(inout); |
442 } | 442 } |
443 | 443 |
444 /////////////////////////////////////////////////////////////////////////////// | 444 /////////////////////////////////////////////////////////////////////////////// |
445 | 445 |
446 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMorphologyEffect); | 446 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMorphologyEffect); |
447 | 447 |
448 const GrFragmentProcessor* GrMorphologyEffect::TestCreate(GrProcessorTestData* d
) { | 448 GrFragmentProcessor* GrMorphologyEffect::TestCreate(GrProcessorTestData* d) { |
449 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: | 449 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: |
450 GrProcessorUnitTest::kAlphaTextureIdx; | 450 GrProcessorUnitTest::kAlphaTextureIdx; |
451 Direction dir = d->fRandom->nextBool() ? kX_Direction : kY_Direction; | 451 Direction dir = d->fRandom->nextBool() ? kX_Direction : kY_Direction; |
452 static const int kMaxRadius = 10; | 452 static const int kMaxRadius = 10; |
453 int radius = d->fRandom->nextRangeU(1, kMaxRadius); | 453 int radius = d->fRandom->nextRangeU(1, kMaxRadius); |
454 MorphologyType type = d->fRandom->nextBool() ? GrMorphologyEffect::kErode_Mo
rphologyType : | 454 MorphologyType type = d->fRandom->nextBool() ? GrMorphologyEffect::kErode_Mo
rphologyType : |
455 GrMorphologyEffect::kDilate_Morph
ologyType; | 455 GrMorphologyEffect::kDilate_Morph
ologyType; |
456 | 456 |
457 return GrMorphologyEffect::Create(d->fProcDataManager, d->fTextures[texIdx],
dir, radius, type); | 457 return GrMorphologyEffect::Create(d->fProcDataManager, d->fTextures[texIdx],
dir, radius, type); |
458 } | 458 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 SkBitmap* result, SkIPoint* offset) con
st { | 662 SkBitmap* result, SkIPoint* offset) con
st { |
663 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 663 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
664 } | 664 } |
665 | 665 |
666 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 666 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
667 SkBitmap* result, SkIPoint* offset) cons
t { | 667 SkBitmap* result, SkIPoint* offset) cons
t { |
668 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 668 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
669 } | 669 } |
670 | 670 |
671 #endif | 671 #endif |
OLD | NEW |