OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "SampleCode.h" | 9 #include "SampleCode.h" |
10 #include "SkView.h" | 10 #include "SkView.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 0x8000FF00, | 177 0x8000FF00, |
178 0x00000000, | 178 0x00000000, |
179 }; | 179 }; |
180 | 180 |
181 float scale = 1.5f; | 181 float scale = 1.5f; |
182 SkPaint paint; | 182 SkPaint paint; |
183 canvas->translate(N / 8, N / 8); | 183 canvas->translate(N / 8, N / 8); |
184 | 184 |
185 for (size_t y = 0; y < SK_ARRAY_COUNT(gColors); y++) { | 185 for (size_t y = 0; y < SK_ARRAY_COUNT(gColors); y++) { |
186 for (size_t x = 0; x < SK_ARRAY_COUNT(gModes); x++) { | 186 for (size_t x = 0; x < SK_ARRAY_COUNT(gModes); x++) { |
187 SkColorFilter* cf = SkColorFilter::CreateModeFilter(gColors[y],
gModes[x]); | 187 paint.setColorFilter(SkColorFilter::MakeModeFilter(gColors[y], g
Modes[x])); |
188 SkSafeUnref(paint.setColorFilter(cf)); | |
189 canvas->drawBitmap(fBitmap, x * N * 1.25f, y * N * scale, &paint
); | 188 canvas->drawBitmap(fBitmap, x * N * 1.25f, y * N * scale, &paint
); |
190 } | 189 } |
191 } | 190 } |
192 | 191 |
193 } | 192 } |
194 | 193 |
195 private: | 194 private: |
196 typedef SampleView INHERITED; | 195 typedef SampleView INHERITED; |
197 }; | 196 }; |
198 | 197 |
199 ////////////////////////////////////////////////////////////////////////////// | 198 ////////////////////////////////////////////////////////////////////////////// |
200 | 199 |
201 static SkView* MyFactory() { return new ColorFilterView; } | 200 static SkView* MyFactory() { return new ColorFilterView; } |
202 static SkViewRegister reg(MyFactory); | 201 static SkViewRegister reg(MyFactory); |
OLD | NEW |