OLD | NEW |
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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 } | 1177 } |
1178 | 1178 |
1179 float sigma3 = 3 * SkScalarToFloat(xformedSigma); | 1179 float sigma3 = 3 * SkScalarToFloat(xformedSigma); |
1180 | 1180 |
1181 SkRect clipRect = SkRect::Make(clipBounds); | 1181 SkRect clipRect = SkRect::Make(clipBounds); |
1182 SkRect srcRect(srcBounds); | 1182 SkRect srcRect(srcBounds); |
1183 | 1183 |
1184 // Outset srcRect and clipRect by 3 * sigma, to compute affected blur area. | 1184 // Outset srcRect and clipRect by 3 * sigma, to compute affected blur area. |
1185 srcRect.outset(sigma3, sigma3); | 1185 srcRect.outset(sigma3, sigma3); |
1186 clipRect.outset(sigma3, sigma3); | 1186 clipRect.outset(sigma3, sigma3); |
1187 srcRect.intersect(clipRect); | 1187 if (!srcRect.intersect(clipRect)) { |
| 1188 srcRect.setEmpty(); |
| 1189 } |
1188 *maskRect = srcRect; | 1190 *maskRect = srcRect; |
1189 return true; | 1191 return true; |
1190 } | 1192 } |
1191 | 1193 |
1192 bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, | 1194 bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, |
1193 const SkMatrix& ctm, | 1195 const SkMatrix& ctm, |
1194 const SkRect& maskRect, | 1196 const SkRect& maskRect, |
1195 GrTexture** result, | 1197 GrTexture** result, |
1196 bool canOverwriteSrc) const { | 1198 bool canOverwriteSrc) const { |
1197 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); | 1199 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 } else { | 1267 } else { |
1266 str->append("None"); | 1268 str->append("None"); |
1267 } | 1269 } |
1268 str->append("))"); | 1270 str->append("))"); |
1269 } | 1271 } |
1270 #endif | 1272 #endif |
1271 | 1273 |
1272 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1274 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1273 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1275 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1274 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1276 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |