OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 static void draw_col(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, | 26 static void draw_col(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, |
27 SkScalar dx) { | 27 SkScalar dx) { |
28 SkPaint paint; | 28 SkPaint paint; |
29 | 29 |
30 SkAutoCanvasRestore acr(canvas, true); | 30 SkAutoCanvasRestore acr(canvas, true); |
31 | 31 |
32 canvas->drawBitmapMatrix(bm, mat, &paint); | 32 canvas->drawBitmapMatrix(bm, mat, &paint); |
33 | 33 |
34 paint.setFilterBitmap(true); | 34 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
35 canvas->translate(dx, 0); | 35 canvas->translate(dx, 0); |
36 canvas->drawBitmapMatrix(bm, mat, &paint); | 36 canvas->drawBitmapMatrix(bm, mat, &paint); |
37 | 37 |
38 paint.setFlags(paint.getFlags() | SkPaint::kHighQualityFilterBitmap_Flag); | 38 paint.setFilterLevel(SkPaint::kHigh_FilterLevel); |
39 canvas->translate(dx, 0); | 39 canvas->translate(dx, 0); |
40 canvas->drawBitmapMatrix(bm, mat, &paint); | 40 canvas->drawBitmapMatrix(bm, mat, &paint); |
41 } | 41 } |
42 | 42 |
43 class FilterBitmapGM : public skiagm::GM { | 43 class FilterBitmapGM : public skiagm::GM { |
44 void onOnceBeforeDraw() { | 44 void onOnceBeforeDraw() { |
45 | 45 |
46 make_bitmap(); | 46 make_bitmap(); |
47 | 47 |
48 SkScalar cx = SkScalarHalf(fBM.width()); | 48 SkScalar cx = SkScalarHalf(fBM.width()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) | 230 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) |
231 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) | 231 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) |
232 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) | 232 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) |
233 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) | 233 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) |
234 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) | 234 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) |
235 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) | 235 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) |
236 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) | 236 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) |
237 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) | 237 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) |
238 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) | 238 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) |
239 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) | 239 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) |
OLD | NEW |