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

Unified Diff: gm/imageblur.cpp

Issue 105893003: NEON fast path for box blur (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove useless prefetch. Created 7 years 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
Index: gm/imageblur.cpp
diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp
index 0e506534c381eaf79a9992f59e5e4c96e19e08b9..7a4630079434fa011e6ef6f8c6ff6e87c2466dac 100644
--- a/gm/imageblur.cpp
+++ b/gm/imageblur.cpp
@@ -16,13 +16,17 @@ namespace skiagm {
class ImageBlurGM : public GM {
public:
- ImageBlurGM() {
+ ImageBlurGM(SkScalar sigmaX, SkScalar sigmaY)
+ : fSigmaX(sigmaX), fSigmaY(sigmaY) {
this->setBGColor(0xFF000000);
}
protected:
virtual SkString onShortName() {
- return SkString("imageblur");
+ SkString name;
+ name.printf("imageblur_%.2f_%.2f",
Stephen White 2013/12/19 15:27:03 This will cause the tools to consider the imageblu
zheng.xu 2013/12/20 04:29:54 Done.
+ SkScalarToFloat(fSigmaX), SkScalarToFloat(fSigmaY));
+ return name;
}
virtual SkISize onISize() {
@@ -31,7 +35,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- paint.setImageFilter(new SkBlurImageFilter(24.0f, 0.0f))->unref();
+ paint.setImageFilter(new SkBlurImageFilter(fSigmaX, fSigmaY))->unref();
canvas->saveLayer(NULL, &paint);
const char* str = "The quick brown fox jumped over the lazy dog.";
@@ -50,12 +54,18 @@ protected:
}
private:
+ SkScalar fSigmaX;
+ SkScalar fSigmaY;
+
typedef GM INHERITED;
};
//////////////////////////////////////////////////////////////////////////////
-static GM* MyFactory(void*) { return new ImageBlurGM; }
-static GMRegistry reg(MyFactory);
+static GM* MyFactory1(void*) { return new ImageBlurGM(24.0f, 0.0f); }
+static GMRegistry reg1(MyFactory1);
+
+static GM* MyFactory2(void*) { return new ImageBlurGM(80.0f, 80.0f); }
+static GMRegistry reg2(MyFactory2);
}

Powered by Google App Engine
This is Rietveld 408576698