OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 /** | 57 /** |
58 * Compare output of drawSprite and drawBitmap (esp. clipping and imagefilters) | 58 * Compare output of drawSprite and drawBitmap (esp. clipping and imagefilters) |
59 */ | 59 */ |
60 class SpriteBitmapGM : public skiagm::GM { | 60 class SpriteBitmapGM : public skiagm::GM { |
61 public: | 61 public: |
62 SpriteBitmapGM() {} | 62 SpriteBitmapGM() {} |
63 | 63 |
64 protected: | 64 protected: |
65 | 65 |
66 SkString onShortName() SK_OVERRIDE { | 66 SkString onShortName() override { |
67 return SkString("spritebitmap"); | 67 return SkString("spritebitmap"); |
68 } | 68 } |
69 | 69 |
70 SkISize onISize() SK_OVERRIDE { | 70 SkISize onISize() override { |
71 return SkISize::Make(640, 480); | 71 return SkISize::Make(640, 480); |
72 } | 72 } |
73 | 73 |
74 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 74 void onDraw(SkCanvas* canvas) override { |
75 SkBitmap bm; | 75 SkBitmap bm; |
76 make_bm(&bm); | 76 make_bm(&bm); |
77 | 77 |
78 int dx = 10; | 78 int dx = 10; |
79 int dy = 10; | 79 int dy = 10; |
80 | 80 |
81 SkScalar sigma = 8; | 81 SkScalar sigma = 8; |
82 SkAutoTUnref<SkImageFilter> filter(SkBlurImageFilter::Create(sigma, sigm
a)); | 82 SkAutoTUnref<SkImageFilter> filter(SkBlurImageFilter::Create(sigma, sigm
a)); |
83 | 83 |
84 draw_2_bitmaps(canvas, bm, false, dx, dy); | 84 draw_2_bitmaps(canvas, bm, false, dx, dy); |
85 dy += bm.height() + 20; | 85 dy += bm.height() + 20; |
86 draw_2_bitmaps(canvas, bm, false, dx, dy, filter); | 86 draw_2_bitmaps(canvas, bm, false, dx, dy, filter); |
87 dy += bm.height() + 20; | 87 dy += bm.height() + 20; |
88 draw_2_bitmaps(canvas, bm, true, dx, dy); | 88 draw_2_bitmaps(canvas, bm, true, dx, dy); |
89 dy += bm.height() + 20; | 89 dy += bm.height() + 20; |
90 draw_2_bitmaps(canvas, bm, true, dx, dy, filter); | 90 draw_2_bitmaps(canvas, bm, true, dx, dy, filter); |
91 } | 91 } |
92 | 92 |
93 private: | 93 private: |
94 typedef GM INHERITED; | 94 typedef GM INHERITED; |
95 }; | 95 }; |
96 | 96 |
97 ////////////////////////////////////////////////////////////////////////////// | 97 ////////////////////////////////////////////////////////////////////////////// |
98 | 98 |
99 DEF_GM( return new SpriteBitmapGM; ) | 99 DEF_GM( return new SpriteBitmapGM; ) |
OLD | NEW |