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

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

Issue 2232263002: Always give simple circular rrects a shot at being directly blurred on the GPU (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 | « no previous file | no next file » | 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"
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 1312
1313 bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRRect& devRRect, 1313 bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRRect& devRRect,
1314 const SkIRect& clipBounds, 1314 const SkIRect& clipBounds,
1315 const SkMatrix& ctm, 1315 const SkMatrix& ctm,
1316 SkRect* maskRect) const { 1316 SkRect* maskRect) const {
1317 SkScalar xformedSigma = this->computeXformedSigma(ctm); 1317 SkScalar xformedSigma = this->computeXformedSigma(ctm);
1318 if (xformedSigma <= 0) { 1318 if (xformedSigma <= 0) {
1319 return false; 1319 return false;
1320 } 1320 }
1321 1321
1322 // We always do circles on the GPU 1322 // We always do circles and simple circular rrects on the GPU
1323 if (!devRRect.isCircle()) { 1323 if (!devRRect.isCircle() && !devRRect.isSimpleCircular()) {
1324 static const SkScalar kMIN_GPU_BLUR_SIZE = SkIntToScalar(64); 1324 static const SkScalar kMIN_GPU_BLUR_SIZE = SkIntToScalar(64);
1325 static const SkScalar kMIN_GPU_BLUR_SIGMA = SkIntToScalar(32); 1325 static const SkScalar kMIN_GPU_BLUR_SIGMA = SkIntToScalar(32);
1326 1326
1327 if (devRRect.width() <= kMIN_GPU_BLUR_SIZE && 1327 if (devRRect.width() <= kMIN_GPU_BLUR_SIZE &&
1328 devRRect.height() <= kMIN_GPU_BLUR_SIZE && 1328 devRRect.height() <= kMIN_GPU_BLUR_SIZE &&
1329 xformedSigma <= kMIN_GPU_BLUR_SIGMA) { 1329 xformedSigma <= kMIN_GPU_BLUR_SIGMA) {
1330 // We prefer to blur small rects with small radii on the CPU. 1330 // We prefer to blur small rects with small radii on the CPU.
1331 return false; 1331 return false;
1332 } 1332 }
1333 } 1333 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 } else { 1428 } else {
1429 str->append("None"); 1429 str->append("None");
1430 } 1430 }
1431 str->append("))"); 1431 str->append("))");
1432 } 1432 }
1433 #endif 1433 #endif
1434 1434
1435 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1435 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1436 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1436 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1437 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1437 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698