Index: gm/imageblur.cpp |
diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp |
index 0e506534c381eaf79a9992f59e5e4c96e19e08b9..4c3f42d825ce194d502013740c9e7a8fd48423ed 100644 |
--- a/gm/imageblur.cpp |
+++ b/gm/imageblur.cpp |
@@ -16,13 +16,15 @@ namespace skiagm { |
class ImageBlurGM : public GM { |
public: |
- ImageBlurGM() { |
+ ImageBlurGM(SkScalar sigmaX, SkScalar sigmaY, const char* suffix) |
+ : fSigmaX(sigmaX), fSigmaY(sigmaY) { |
this->setBGColor(0xFF000000); |
+ fName.printf("imageblur%s", suffix); |
} |
protected: |
virtual SkString onShortName() { |
- return SkString("imageblur"); |
+ return fName; |
} |
virtual SkISize onISize() { |
@@ -31,7 +33,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 +52,19 @@ protected: |
} |
private: |
+ SkScalar fSigmaX; |
+ SkScalar fSigmaY; |
+ SkString fName; |
+ |
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, "_large"); } |
+static GMRegistry reg2(MyFactory2); |
} |