OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 canvas->translate(SkIntToScalar(16), SkIntToScalar(-32)); | 119 canvas->translate(SkIntToScalar(16), SkIntToScalar(-32)); |
120 } | 120 } |
121 canvas->drawCircle(r.centerX(), r.centerY(), | 121 canvas->drawCircle(r.centerX(), r.centerY(), |
122 SkScalarDiv(r.width()*2, SkIntToScalar(5)), p
aint); | 122 SkScalarDiv(r.width()*2, SkIntToScalar(5)), p
aint); |
123 canvas->restore(); | 123 canvas->restore(); |
124 canvas->translate(r.width() + margin, 0); | 124 canvas->translate(r.width() + margin, 0); |
125 } | 125 } |
126 canvas->restore(); | 126 canvas->restore(); |
127 canvas->translate(0, r.height() + margin); | 127 canvas->translate(0, r.height() + margin); |
128 } | 128 } |
| 129 |
| 130 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) { |
| 131 SkSafeUnref(filters[i]); |
| 132 } |
129 } | 133 } |
130 | 134 |
131 private: | 135 private: |
132 bool fInitialized; | 136 bool fInitialized; |
133 SkBitmap fCheckerboard; | 137 SkBitmap fCheckerboard; |
134 SkBitmap fGradientCircle; | 138 SkBitmap fGradientCircle; |
135 typedef GM INHERITED; | 139 typedef GM INHERITED; |
136 }; | 140 }; |
137 | 141 |
138 ////////////////////////////////////////////////////////////////////////////// | 142 ////////////////////////////////////////////////////////////////////////////// |
139 | 143 |
140 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; } | 144 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; } |
141 static GMRegistry reg(MyFactory); | 145 static GMRegistry reg(MyFactory); |
142 | 146 |
143 } | 147 } |
OLD | NEW |