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 "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm, | 33 static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm, |
34 SkScalar x, SkScalar y, SkPaint* paint) { | 34 SkScalar x, SkScalar y, SkPaint* paint) { |
35 canvas->drawBitmap(bm, x, y, paint); | 35 canvas->drawBitmap(bm, x, y, paint); |
36 return SkIntToScalar(bm.width()) * 5/4; | 36 return SkIntToScalar(bm.width()) * 5/4; |
37 } | 37 } |
38 | 38 |
39 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, | 39 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, |
40 SkPaint* p) { | 40 SkPaint* p) { |
41 x += draw_bm(c, bm, x, 0, p); | 41 x += draw_bm(c, bm, x, 0, p); |
42 p->setFilterBitmap(true); | 42 p->setFilterLevel(SkPaint::kLow_FilterLevel); |
43 x += draw_bm(c, bm, x, 0, p); | 43 x += draw_bm(c, bm, x, 0, p); |
44 p->setDither(true); | 44 p->setDither(true); |
45 return x + draw_bm(c, bm, x, 0, p); | 45 return x + draw_bm(c, bm, x, 0, p); |
46 } | 46 } |
47 | 47 |
48 static const char* gConfigNames[] = { | 48 static const char* gConfigNames[] = { |
49 "unknown config", | 49 "unknown config", |
50 "A1", | 50 "A1", |
51 "A8", | 51 "A8", |
52 "Index8", | 52 "Index8", |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 private: | 124 private: |
125 typedef GM INHERITED; | 125 typedef GM INHERITED; |
126 }; | 126 }; |
127 | 127 |
128 ////////////////////////////////////////////////////////////////////////////// | 128 ////////////////////////////////////////////////////////////////////////////// |
129 | 129 |
130 static GM* MyFactory(void*) { return new FilterGM; } | 130 static GM* MyFactory(void*) { return new FilterGM; } |
131 static GMRegistry reg(MyFactory); | 131 static GMRegistry reg(MyFactory); |
132 | 132 |
133 } | 133 } |
OLD | NEW |