Chromium Code Reviews| Index: gm/imagefiltersbase.cpp |
| diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp |
| index ea32769d4d697b799f1fb63b1716ec2238245683..50edbbcafee163323b661416f8f37e373beafebb 100644 |
| --- a/gm/imagefiltersbase.cpp |
| +++ b/gm/imagefiltersbase.cpp |
| @@ -254,8 +254,46 @@ protected: |
| private: |
| typedef GM INHERITED; |
| }; |
| +DEF_GM( return new ImageFiltersBaseGM; ) |
| /////////////////////////////////////////////////////////////////////////////// |
|
robertphillips
2015/03/19 19:11:48
// This GM tests that LCD text is disabled when im
|
| -static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } |
| -static skiagm::GMRegistry reg(MyFactory); |
| +class ImageFiltersTextGM : public skiagm::GM { |
| +public: |
| + ImageFiltersTextGM () {} |
| + |
| +protected: |
|
robertphillips
2015/03/19 19:11:49
override throughout ?
one line ?
|
| + virtual SkString onShortName() { |
| + return SkString("imagefilterstext"); |
| + } |
| + |
|
robertphillips
2015/03/19 19:11:48
Does this GM need to be this large?
|
| + virtual SkISize onISize() { return SkISize::Make(700, 500); } |
| + |
| + virtual void onDraw(SkCanvas* canvas) { |
| + const uint32_t flags[] = { |
| + 0, |
| + SkPaint::kAntiAlias_Flag, |
| + SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag, |
| + }; |
| + |
| + SkAutoTUnref<SkImageFilter> imgf(SkBlurImageFilter::Create(0.5f, 0.5f)); |
| + SkPaint paint; |
| + paint.setTextSize(30); |
| + |
| + canvas->translate(20, 40); |
|
robertphillips
2015/03/19 19:11:48
Wouldn't it be a more explicit test to actually pe
|
| + for (size_t i = 0; i < SK_ARRAY_COUNT(flags); ++i) { |
| + paint.setFlags(flags[i]); |
| + |
| + paint.setImageFilter(NULL); |
| + canvas->drawText("Hamburgefons", 11, 0, 0, paint); |
| + paint.setImageFilter(imgf); |
| + canvas->drawText("Hamburgefons", 11, 250, 0, paint); |
| + canvas->translate(0, 40); |
| + } |
| + } |
| + |
| +private: |
| + typedef GM INHERITED; |
| +}; |
| +DEF_GM( return new ImageFiltersTextGM; ) |
| + |