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 "SkColor.h" | 9 #include "SkColor.h" |
10 #include "SkBicubicImageFilter.h" | 10 #include "SkBicubicImageFilter.h" |
11 | 11 |
12 namespace skiagm { | 12 namespace skiagm { |
13 | 13 |
14 class BicubicGM : public GM { | 14 class BicubicGM : public GM { |
15 public: | 15 public: |
16 BicubicGM() : fInitialized(false) { | 16 BicubicGM() : fInitialized(false) { |
17 this->setBGColor(0x00000000); | 17 this->setBGColor(0x00000000); |
18 } | 18 } |
19 | 19 |
20 protected: | 20 protected: |
| 21 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 22 return kSkipTiled_Flag; |
| 23 } |
| 24 |
21 virtual SkString onShortName() { | 25 virtual SkString onShortName() { |
22 return SkString("bicubicfilter"); | 26 return SkString("bicubicfilter"); |
23 } | 27 } |
24 | 28 |
25 void make_checkerboard(int width, int height) { | 29 void make_checkerboard(int width, int height) { |
26 SkASSERT(width % 2 == 0); | 30 SkASSERT(width % 2 == 0); |
27 SkASSERT(height % 2 == 0); | 31 SkASSERT(height % 2 == 0); |
28 fCheckerboard.allocN32Pixels(width, height); | 32 fCheckerboard.allocN32Pixels(width, height); |
29 for (int y = 0; y < height; y += 2) { | 33 for (int y = 0; y < height; y += 2) { |
30 SkPMColor* s = fCheckerboard.getAddr32(0, y); | 34 SkPMColor* s = fCheckerboard.getAddr32(0, y); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 SkBitmap fCheckerboard; | 77 SkBitmap fCheckerboard; |
74 bool fInitialized; | 78 bool fInitialized; |
75 }; | 79 }; |
76 | 80 |
77 ////////////////////////////////////////////////////////////////////////////// | 81 ////////////////////////////////////////////////////////////////////////////// |
78 | 82 |
79 static GM* MyFactory(void*) { return new BicubicGM; } | 83 static GM* MyFactory(void*) { return new BicubicGM; } |
80 static GMRegistry reg(MyFactory); | 84 static GMRegistry reg(MyFactory); |
81 | 85 |
82 } | 86 } |
OLD | NEW |