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

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

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 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
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkColorFilters.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); 809 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>();
810 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); 810 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect();
811 } 811 }
812 812
813 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { 813 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
814 inout->mulByUnknownSingleComponent(); 814 inout->mulByUnknownSingleComponent();
815 } 815 }
816 816
817 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); 817 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect);
818 818
819 GrFragmentProcessor* GrRectBlurEffect::TestCreate(GrProcessorTestData* d) { 819 const GrFragmentProcessor* GrRectBlurEffect::TestCreate(GrProcessorTestData* d) {
820 float sigma = d->fRandom->nextRangeF(3,8); 820 float sigma = d->fRandom->nextRangeF(3,8);
821 float width = d->fRandom->nextRangeF(200,300); 821 float width = d->fRandom->nextRangeF(200,300);
822 float height = d->fRandom->nextRangeF(200,300); 822 float height = d->fRandom->nextRangeF(200,300);
823 return GrRectBlurEffect::Create(d->fContext->textureProvider(), SkRect::Make WH(width, height), 823 return GrRectBlurEffect::Create(d->fContext->textureProvider(), SkRect::Make WH(width, height),
824 sigma); 824 sigma);
825 } 825 }
826 826
827 827
828 bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrTextureProvider* texProvider, 828 bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrTextureProvider* texProvider,
829 GrDrawContext* drawContext, 829 GrDrawContext* drawContext,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const { 991 bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const {
992 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); 992 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>();
993 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig ma == rrbe.fSigma; 993 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig ma == rrbe.fSigma;
994 } 994 }
995 995
996 ////////////////////////////////////////////////////////////////////////////// 996 //////////////////////////////////////////////////////////////////////////////
997 997
998 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect); 998 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect);
999 999
1000 GrFragmentProcessor* GrRRectBlurEffect::TestCreate(GrProcessorTestData* d) { 1000 const GrFragmentProcessor* GrRRectBlurEffect::TestCreate(GrProcessorTestData* d) {
1001 SkScalar w = d->fRandom->nextRangeScalar(100.f, 1000.f); 1001 SkScalar w = d->fRandom->nextRangeScalar(100.f, 1000.f);
1002 SkScalar h = d->fRandom->nextRangeScalar(100.f, 1000.f); 1002 SkScalar h = d->fRandom->nextRangeScalar(100.f, 1000.f);
1003 SkScalar r = d->fRandom->nextRangeF(1.f, 9.f); 1003 SkScalar r = d->fRandom->nextRangeF(1.f, 9.f);
1004 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); 1004 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
1005 SkRRect rrect; 1005 SkRRect rrect;
1006 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); 1006 rrect.setRectXY(SkRect::MakeWH(w, h), r, r);
1007 return GrRRectBlurEffect::Create(d->fContext->textureProvider(), sigma, rrec t); 1007 return GrRRectBlurEffect::Create(d->fContext->textureProvider(), sigma, rrec t);
1008 } 1008 }
1009 1009
1010 ////////////////////////////////////////////////////////////////////////////// 1010 //////////////////////////////////////////////////////////////////////////////
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 } else { 1266 } else {
1267 str->append("None"); 1267 str->append("None");
1268 } 1268 }
1269 str->append("))"); 1269 str->append("))");
1270 } 1270 }
1271 #endif 1271 #endif
1272 1272
1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1274 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1274 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkColorFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698