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

Unified Diff: bench/BlurBench.cpp

Issue 23701006: Push sigma-based blur interface into our GMs/benches/tests/samplecode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleaned up Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bench/BlurRectBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BlurBench.cpp
===================================================================
--- bench/BlurBench.cpp (revision 11108)
+++ bench/BlurBench.cpp (working copy)
@@ -6,6 +6,7 @@
* found in the LICENSE file.
*/
#include "SkBenchmark.h"
+#include "SkBlurMask.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
@@ -32,12 +33,14 @@
SkString fName;
public:
- BlurBench(void* param, SkScalar rad, SkBlurMaskFilter::BlurStyle bs, uint32_t flags = 0) : INHERITED(param) {
+ BlurBench(void* param, SkScalar rad, SkBlurMaskFilter::BlurStyle bs, uint32_t flags = 0)
+ : INHERITED(param) {
fRadius = rad;
fStyle = bs;
fFlags = flags;
const char* name = rad > 0 ? gStyleName[bs] : "none";
- const char* quality = flags & SkBlurMaskFilter::kHighQuality_BlurFlag ? "high_quality" : "low_quality";
+ const char* quality = flags & SkBlurMaskFilter::kHighQuality_BlurFlag ? "high_quality"
+ : "low_quality";
if (SkScalarFraction(rad) != 0) {
fName.printf("blur_%.2f_%s_%s", SkScalarToFloat(rad), name, quality);
} else {
@@ -63,7 +66,9 @@
r.offset(fRadius, fRadius);
if (fRadius > 0) {
- SkMaskFilter* mf = SkBlurMaskFilter::Create(fRadius, fStyle, fFlags);
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(fStyle,
+ SkBlurMask::ConvertRadiusToSigma(fRadius),
+ fFlags);
paint.setMaskFilter(mf)->unref();
}
canvas->drawOval(r, paint);
« no previous file with comments | « no previous file | bench/BlurRectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698