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

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

Issue 2236493002: Revert of Create blurred RRect mask on GPU (rather than uploading it) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/core/SkMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.h » ('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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkBlurMaskFilter.h" 8 #include "SkBlurMaskFilter.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkGpuBlurUtils.h" 10 #include "SkGpuBlurUtils.h"
11 #include "SkReadBuffer.h" 11 #include "SkReadBuffer.h"
12 #include "SkWriteBuffer.h" 12 #include "SkWriteBuffer.h"
13 #include "SkMaskFilter.h" 13 #include "SkMaskFilter.h"
14 #include "SkRRect.h" 14 #include "SkRRect.h"
15 #include "SkStringUtils.h" 15 #include "SkStringUtils.h"
16 #include "SkStrokeRec.h" 16 #include "SkStrokeRec.h"
17 17
18 #if SK_SUPPORT_GPU 18 #if SK_SUPPORT_GPU
19 #include "GrCircleBlurFragmentProcessor.h" 19 #include "GrCircleBlurFragmentProcessor.h"
20 #include "GrContext.h" 20 #include "GrContext.h"
21 #include "GrDrawContext.h" 21 #include "GrDrawContext.h"
22 #include "GrTexture.h" 22 #include "GrTexture.h"
23 #include "GrFragmentProcessor.h" 23 #include "GrFragmentProcessor.h"
24 #include "GrInvariantOutput.h" 24 #include "GrInvariantOutput.h"
25 #include "GrStyle.h" 25 #include "SkDraw.h"
26 #include "effects/GrSimpleTextureEffect.h" 26 #include "effects/GrSimpleTextureEffect.h"
27 #include "glsl/GrGLSLFragmentProcessor.h" 27 #include "glsl/GrGLSLFragmentProcessor.h"
28 #include "glsl/GrGLSLFragmentShaderBuilder.h" 28 #include "glsl/GrGLSLFragmentShaderBuilder.h"
29 #include "glsl/GrGLSLProgramDataManager.h" 29 #include "glsl/GrGLSLProgramDataManager.h"
30 #include "glsl/GrGLSLSampler.h" 30 #include "glsl/GrGLSLSampler.h"
31 #include "glsl/GrGLSLUniformHandler.h" 31 #include "glsl/GrGLSLUniformHandler.h"
32 #endif 32 #endif
33 33
34 SkScalar SkBlurMaskFilter::ConvertRadiusToSigma(SkScalar radius) { 34 SkScalar SkBlurMaskFilter::ConvertRadiusToSigma(SkScalar radius) {
35 return SkBlurMask::ConvertRadiusToSigma(radius); 35 return SkBlurMask::ConvertRadiusToSigma(radius);
(...skipping 13 matching lines...) Expand all
49 const SkIRect& clipBounds, 49 const SkIRect& clipBounds,
50 const SkMatrix& ctm, 50 const SkMatrix& ctm,
51 SkRect* maskRect) const override; 51 SkRect* maskRect) const override;
52 bool directFilterMaskGPU(GrTextureProvider* texProvider, 52 bool directFilterMaskGPU(GrTextureProvider* texProvider,
53 GrDrawContext* drawContext, 53 GrDrawContext* drawContext,
54 GrPaint* grp, 54 GrPaint* grp,
55 const GrClip&, 55 const GrClip&,
56 const SkMatrix& viewMatrix, 56 const SkMatrix& viewMatrix,
57 const SkStrokeRec& strokeRec, 57 const SkStrokeRec& strokeRec,
58 const SkPath& path) const override; 58 const SkPath& path) const override;
59 bool directFilterRRectMaskGPU(GrContext*, 59 bool directFilterRRectMaskGPU(GrTextureProvider* texProvider,
60 GrDrawContext* drawContext, 60 GrDrawContext* drawContext,
61 GrPaint* grp, 61 GrPaint* grp,
62 const GrClip&, 62 const GrClip&,
63 const SkMatrix& viewMatrix, 63 const SkMatrix& viewMatrix,
64 const SkStrokeRec& strokeRec, 64 const SkStrokeRec& strokeRec,
65 const SkRRect& rrect) const override; 65 const SkRRect& rrect) const override;
66 bool filterMaskGPU(GrTexture* src, 66 bool filterMaskGPU(GrTexture* src,
67 const SkMatrix& ctm, 67 const SkMatrix& ctm,
68 const SkIRect& maskRect, 68 const SkIRect& maskRect,
69 GrTexture** result) const override; 69 GrTexture** result) const override;
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 903
904 drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), rect, invers e); 904 drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), rect, invers e);
905 return true; 905 return true;
906 } 906 }
907 907
908 ////////////////////////////////////////////////////////////////////////////// 908 //////////////////////////////////////////////////////////////////////////////
909 909
910 class GrRRectBlurEffect : public GrFragmentProcessor { 910 class GrRRectBlurEffect : public GrFragmentProcessor {
911 public: 911 public:
912 912
913 static sk_sp<GrFragmentProcessor> Make(GrContext*, float sigma, const SkRRec t&); 913 static sk_sp<GrFragmentProcessor> Make(GrTextureProvider*, float sigma, cons t SkRRect&);
914 914
915 virtual ~GrRRectBlurEffect() {}; 915 virtual ~GrRRectBlurEffect() {};
916 const char* name() const override { return "GrRRectBlur"; } 916 const char* name() const override { return "GrRRectBlur"; }
917 917
918 const SkRRect& getRRect() const { return fRRect; } 918 const SkRRect& getRRect() const { return fRRect; }
919 float getSigma() const { return fSigma; } 919 float getSigma() const { return fSigma; }
920 920
921 private: 921 private:
922 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; 922 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
923 923
924 GrRRectBlurEffect(float sigma, const SkRRect&, GrTexture* profileTexture); 924 GrRRectBlurEffect(float sigma, const SkRRect&, GrTexture* profileTexture);
925 925
926 virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps, 926 virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps,
927 GrProcessorKeyBuilder* b) const override; 927 GrProcessorKeyBuilder* b) const override;
928 928
929 bool onIsEqual(const GrFragmentProcessor& other) const override; 929 bool onIsEqual(const GrFragmentProcessor& other) const override;
930 930
931 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; 931 void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
932 932
933 SkRRect fRRect; 933 SkRRect fRRect;
934 float fSigma; 934 float fSigma;
935 GrTextureAccess fNinePatchAccess; 935 GrTextureAccess fNinePatchAccess;
936 936
937 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 937 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
938 938
939 typedef GrFragmentProcessor INHERITED; 939 typedef GrFragmentProcessor INHERITED;
940 }; 940 };
941 941
942 bool SkBlurMaskFilter::ComputeBlurredRRectParams(const SkRRect& rrect,
943 SkScalar sigma,
944 SkRRect* rrectToDraw,
945 SkISize* widthHeight,
946 SkScalar xs[4],
947 int* numXs,
948 SkScalar ys[4],
949 int* numYs) {
950 unsigned int blurRadius = 3*SkScalarCeilToInt(sigma-1/6.0f);
951 942
952 const SkRect& orig = rrect.getBounds(); 943 sk_sp<GrFragmentProcessor> GrRRectBlurEffect::Make(GrTextureProvider* texProvide r, float sigma,
953 const SkVector& radiiUL = rrect.radii(SkRRect::kUpperLeft_Corner); 944 const SkRRect& rrect) {
954 const SkVector& radiiUR = rrect.radii(SkRRect::kUpperRight_Corner); 945 if (rrect.isCircle()) {
955 const SkVector& radiiLR = rrect.radii(SkRRect::kLowerRight_Corner); 946 return GrCircleBlurFragmentProcessor::Make(texProvider, rrect.rect(), si gma);
956 const SkVector& radiiLL = rrect.radii(SkRRect::kLowerLeft_Corner);
957
958 const int left = SkScalarCeilToInt(SkTMax<SkScalar>(radiiUL.fX, radiiLL.fX) );
959 const int top = SkScalarCeilToInt(SkTMax<SkScalar>(radiiUL.fY, radiiUR.fY) );
960 const int right = SkScalarCeilToInt(SkTMax<SkScalar>(radiiUR.fX, radiiLR.fX) );
961 const int bot = SkScalarCeilToInt(SkTMax<SkScalar>(radiiLL.fY, radiiLR.fY) );
962
963 // This is a conservative check for nine-patchability
964 if (orig.fLeft + left + blurRadius >= orig.fRight - right - blurRadius ||
965 orig.fTop + top + blurRadius >= orig.fBottom - bot - blurRadius) {
966 return false;
967 } 947 }
968 948
969 int newRRWidth, newRRHeight;
970
971 // 3x3 case
972 newRRWidth = 2*blurRadius + left + right + 1;
973 newRRHeight = 2*blurRadius + top + bot + 1;
974 widthHeight->fWidth = newRRWidth + 2 * blurRadius;
975 widthHeight->fHeight = newRRHeight + 2 * blurRadius;
976 // TODO: need to return non-normalized indices
977 xs[0] = 0.0f;
978 xs[1] = (blurRadius + left) / (float) widthHeight->fWidth;
979 xs[2] = (blurRadius + left + 1.0f) / widthHeight->fWidth;
980 xs[3] = 1.0f;
981 *numXs = 4;
982 ys[0] = 0.0f;
983 ys[1] = (blurRadius + top) / (float) widthHeight->fHeight;
984 ys[2] = (blurRadius + top + 1.0f) / widthHeight->fHeight;
985 ys[3] = 1.0f;
986 *numYs = 4;
987
988 const SkRect newRect = SkRect::MakeXYWH(SkIntToScalar(blurRadius), SkIntToSc alar(blurRadius),
989 SkIntToScalar(newRRWidth), SkIntToSc alar(newRRHeight));
990 SkVector newRadii[4];
991 newRadii[0] = { SkScalarCeilToScalar(radiiUL.fX), SkScalarCeilToScalar(radii UL.fY) };
992 newRadii[1] = { SkScalarCeilToScalar(radiiUR.fX), SkScalarCeilToScalar(radii UR.fY) };
993 newRadii[2] = { SkScalarCeilToScalar(radiiLR.fX), SkScalarCeilToScalar(radii LR.fY) };
994 newRadii[3] = { SkScalarCeilToScalar(radiiLL.fX), SkScalarCeilToScalar(radii LL.fY) };
995
996 rrectToDraw->setRectRadii(newRect, newRadii);
997 return true;
998 }
999
1000 static sk_sp<GrTexture> make_rrect_blur_mask(GrContext* context,
1001 const SkRRect& rrect,
1002 float sigma) {
1003 SkRRect rrectToDraw;
1004 SkISize size;
1005 SkScalar xs[4], ys[4];
1006 int numXs, numYs;
1007
1008 SkBlurMaskFilter::ComputeBlurredRRectParams(rrect, sigma, &rrectToDraw, &siz e,
1009 xs, &numXs, ys, &numYs);
1010
1011 // TODO: this could be approx but the texture coords will need to be updated
1012 sk_sp<GrDrawContext> dc(context->makeDrawContext(SkBackingFit::kExact,
1013 size.fWidth, size.fHeight,
1014 kAlpha_8_GrPixelConfig, nul lptr));
1015 if (!dc) {
1016 return nullptr;
1017 }
1018
1019 GrPaint grPaint;
1020
1021 dc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle::Simp leFill());
1022
1023 sk_sp<GrDrawContext> dc2(SkGpuBlurUtils::GaussianBlur(context,
1024 dc->asTexture().releas e(),
1025 nullptr,
1026 SkIRect::MakeWH(size.f Width,
1027 size.f Height),
1028 nullptr,
1029 sigma, sigma, SkBackin gFit::kExact));
1030 if (!dc2) {
1031 return nullptr;
1032 }
1033
1034 return dc2->asTexture();
1035 }
1036
1037 sk_sp<GrFragmentProcessor> GrRRectBlurEffect::Make(GrContext* context, float sig ma,
1038 const SkRRect& rrect) {
1039 if (rrect.isCircle()) {
1040 return GrCircleBlurFragmentProcessor::Make(context->textureProvider(),
1041 rrect.rect(), sigma);
1042 }
1043
1044 // TODO: loosen this up
1045 if (!rrect.isSimpleCircular()) { 949 if (!rrect.isSimpleCircular()) {
1046 return nullptr; 950 return nullptr;
1047 } 951 }
1048 952
1049 // Make sure we can successfully ninepatch this rrect -- the blur sigma has to be 953 // Make sure we can successfully ninepatch this rrect -- the blur sigma has to be
1050 // sufficiently small relative to both the size of the corner radius and the 954 // sufficiently small relative to both the size of the corner radius and the
1051 // width (and height) of the rrect. 955 // width (and height) of the rrect.
1052 956
1053 unsigned int blurRadius = 3*SkScalarCeilToInt(sigma-1/6.0f); 957 unsigned int blurRadius = 3*SkScalarCeilToInt(sigma-1/6.0f);
1054 unsigned int cornerRadius = SkScalarCeilToInt(rrect.getSimpleRadii().x()); 958 unsigned int cornerRadius = SkScalarCeilToInt(rrect.getSimpleRadii().x());
1055 if (cornerRadius + blurRadius > rrect.width()/2 || 959 if (cornerRadius + blurRadius > rrect.width()/2 ||
1056 cornerRadius + blurRadius > rrect.height()/2) { 960 cornerRadius + blurRadius > rrect.height()/2) {
1057 return nullptr; 961 return nullptr;
1058 } 962 }
1059 963
1060 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); 964 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
1061 GrUniqueKey key; 965 GrUniqueKey key;
1062 GrUniqueKey::Builder builder(&key, kDomain, 2); 966 GrUniqueKey::Builder builder(&key, kDomain, 2);
1063 builder[0] = blurRadius; 967 builder[0] = blurRadius;
1064 builder[1] = cornerRadius; 968 builder[1] = cornerRadius;
1065 builder.finish(); 969 builder.finish();
1066 970
1067 sk_sp<GrTexture> blurNinePatchTexture( 971 SkAutoTUnref<GrTexture> blurNinePatchTexture(texProvider->findAndRefTextureB yUniqueKey(key));
1068 context->textureProvider()->findAndRefTextureByU niqueKey(key));
1069 972
1070 if (!blurNinePatchTexture) { 973 if (!blurNinePatchTexture) {
1071 blurNinePatchTexture = make_rrect_blur_mask(context, rrect, sigma); 974 SkMask mask;
975
976 unsigned int smallRectSide = 2*(blurRadius + cornerRadius) + 1;
977
978 mask.fBounds = SkIRect::MakeWH(smallRectSide, smallRectSide);
979 mask.fFormat = SkMask::kA8_Format;
980 mask.fRowBytes = mask.fBounds.width();
981 mask.fImage = SkMask::AllocImage(mask.computeTotalImageSize());
982 SkAutoMaskFreeImage amfi(mask.fImage);
983
984 memset(mask.fImage, 0, mask.computeTotalImageSize());
985
986 SkRect smallRect;
987 smallRect.setWH(SkIntToScalar(smallRectSide), SkIntToScalar(smallRectSid e));
988
989 SkRRect smallRRect;
990 smallRRect.setRectXY(smallRect, SkIntToScalar(cornerRadius), SkIntToScal ar(cornerRadius));
991
992 SkPath path;
993 path.addRRect(smallRRect);
994
995 SkDraw::DrawToMask(path, &mask.fBounds, nullptr, nullptr, &mask,
996 SkMask::kJustRenderImage_CreateMode, SkStrokeRec::kFi ll_InitStyle);
997
998 SkMask blurredMask;
999 if (!SkBlurMask::BoxBlur(&blurredMask, mask, sigma, kNormal_SkBlurStyle,
1000 kHigh_SkBlurQuality, nullptr, true)) {
1001 return nullptr;
1002 }
1003
1004 unsigned int texSide = smallRectSide + 2*blurRadius;
1005 GrSurfaceDesc texDesc;
1006 texDesc.fWidth = texSide;
1007 texDesc.fHeight = texSide;
1008 texDesc.fConfig = kAlpha_8_GrPixelConfig;
1009 texDesc.fIsMipMapped = false;
1010
1011 blurNinePatchTexture.reset(
1012 texProvider->createTexture(texDesc, SkBudgeted::kYes , blurredMask.f Image, 0));
1013 SkMask::FreeImage(blurredMask.fImage);
1072 if (!blurNinePatchTexture) { 1014 if (!blurNinePatchTexture) {
1073 return nullptr; 1015 return nullptr;
1074 } 1016 }
1075 context->textureProvider()->assignUniqueKeyToTexture(key, blurNinePatchT exture.get()); 1017 texProvider->assignUniqueKeyToTexture(key, blurNinePatchTexture);
1076 } 1018 }
1077 return sk_sp<GrFragmentProcessor>(new GrRRectBlurEffect(sigma, rrect, blurNi nePatchTexture.get())); 1019 return sk_sp<GrFragmentProcessor>(new GrRRectBlurEffect(sigma, rrect, blurNi nePatchTexture));
1078 } 1020 }
1079 1021
1080 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { 1022 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
1081 inout->mulByUnknownSingleComponent(); 1023 inout->mulByUnknownSingleComponent();
1082 } 1024 }
1083 1025
1084 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur e *ninePatchTexture) 1026 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur e *ninePatchTexture)
1085 : fRRect(rrect), 1027 : fRRect(rrect),
1086 fSigma(sigma), 1028 fSigma(sigma),
1087 fNinePatchAccess(ninePatchTexture) { 1029 fNinePatchAccess(ninePatchTexture) {
(...skipping 13 matching lines...) Expand all
1101 1043
1102 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect); 1044 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect);
1103 1045
1104 sk_sp<GrFragmentProcessor> GrRRectBlurEffect::TestCreate(GrProcessorTestData* d) { 1046 sk_sp<GrFragmentProcessor> GrRRectBlurEffect::TestCreate(GrProcessorTestData* d) {
1105 SkScalar w = d->fRandom->nextRangeScalar(100.f, 1000.f); 1047 SkScalar w = d->fRandom->nextRangeScalar(100.f, 1000.f);
1106 SkScalar h = d->fRandom->nextRangeScalar(100.f, 1000.f); 1048 SkScalar h = d->fRandom->nextRangeScalar(100.f, 1000.f);
1107 SkScalar r = d->fRandom->nextRangeF(1.f, 9.f); 1049 SkScalar r = d->fRandom->nextRangeF(1.f, 9.f);
1108 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); 1050 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
1109 SkRRect rrect; 1051 SkRRect rrect;
1110 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); 1052 rrect.setRectXY(SkRect::MakeWH(w, h), r, r);
1111 return GrRRectBlurEffect::Make(d->fContext, sigma, rrect); 1053 return GrRRectBlurEffect::Make(d->fContext->textureProvider(), sigma, rrect) ;
1112 } 1054 }
1113 1055
1114 ////////////////////////////////////////////////////////////////////////////// 1056 //////////////////////////////////////////////////////////////////////////////
1115 1057
1116 class GrGLRRectBlurEffect : public GrGLSLFragmentProcessor { 1058 class GrGLRRectBlurEffect : public GrGLSLFragmentProcessor {
1117 public: 1059 public:
1118 void emitCode(EmitArgs&) override; 1060 void emitCode(EmitArgs&) override;
1119 1061
1120 protected: 1062 protected:
1121 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override ; 1063 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override ;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 1146
1205 void GrRRectBlurEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, 1147 void GrRRectBlurEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
1206 GrProcessorKeyBuilder* b) const { 1148 GrProcessorKeyBuilder* b) const {
1207 GrGLRRectBlurEffect::GenKey(*this, caps, b); 1149 GrGLRRectBlurEffect::GenKey(*this, caps, b);
1208 } 1150 }
1209 1151
1210 GrGLSLFragmentProcessor* GrRRectBlurEffect::onCreateGLSLInstance() const { 1152 GrGLSLFragmentProcessor* GrRRectBlurEffect::onCreateGLSLInstance() const {
1211 return new GrGLRRectBlurEffect; 1153 return new GrGLRRectBlurEffect;
1212 } 1154 }
1213 1155
1214 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, 1156 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrTextureProvider* texProvid er,
1215 GrDrawContext* drawContext, 1157 GrDrawContext* drawContext,
1216 GrPaint* grp, 1158 GrPaint* grp,
1217 const GrClip& clip, 1159 const GrClip& clip,
1218 const SkMatrix& viewMatrix, 1160 const SkMatrix& viewMatrix,
1219 const SkStrokeRec& strokeRec , 1161 const SkStrokeRec& strokeRec ,
1220 const SkRRect& rrect) const { 1162 const SkRRect& rrect) const {
1221 SkASSERT(drawContext); 1163 SkASSERT(drawContext);
1222 1164
1223 if (fBlurStyle != kNormal_SkBlurStyle) { 1165 if (fBlurStyle != kNormal_SkBlurStyle) {
1224 return false; 1166 return false;
1225 } 1167 }
1226 1168
1227 if (!strokeRec.isFillStyle()) { 1169 if (!strokeRec.isFillStyle()) {
1228 return false; 1170 return false;
1229 } 1171 }
1230 1172
1231 SkScalar xformedSigma = this->computeXformedSigma(viewMatrix); 1173 SkScalar xformedSigma = this->computeXformedSigma(viewMatrix);
1232 1174
1233 sk_sp<GrFragmentProcessor> fp(GrRRectBlurEffect::Make(context, xformedSigma, rrect)); 1175 sk_sp<GrFragmentProcessor> fp(GrRRectBlurEffect::Make(texProvider, xformedSi gma, rrect));
1234 if (!fp) { 1176 if (!fp) {
1235 return false; 1177 return false;
1236 } 1178 }
1237 1179
1238 grp->addCoverageFragmentProcessor(std::move(fp)); 1180 grp->addCoverageFragmentProcessor(std::move(fp));
1239 1181
1240 SkMatrix inverse; 1182 SkMatrix inverse;
1241 if (!viewMatrix.invert(&inverse)) { 1183 if (!viewMatrix.invert(&inverse)) {
1242 return false; 1184 return false;
1243 } 1185 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 } else { 1313 } else {
1372 str->append("None"); 1314 str->append("None");
1373 } 1315 }
1374 str->append("))"); 1316 str->append("))");
1375 } 1317 }
1376 #endif 1318 #endif
1377 1319
1378 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1379 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1321 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1380 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1322 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/core/SkMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698