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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p
) { | 60 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p
) { |
61 x += draw_bm(c, bm, x, 0, p); | 61 x += draw_bm(c, bm, x, 0, p); |
62 p->setFilterLevel(SkPaint::kLow_FilterLevel); | 62 p->setFilterLevel(SkPaint::kLow_FilterLevel); |
63 x += draw_bm(c, bm, x, 0, p); | 63 x += draw_bm(c, bm, x, 0, p); |
64 p->setDither(true); | 64 p->setDither(true); |
65 return x + draw_bm(c, bm, x, 0, p); | 65 return x + draw_bm(c, bm, x, 0, p); |
66 } | 66 } |
67 | 67 |
68 static const char* gConfigNames[] = { | 68 static const char* gConfigNames[] = { |
69 "unknown config", | 69 "unknown config", |
70 "A1", | |
71 "A8", | 70 "A8", |
72 "Index8", | 71 "Index8", |
73 "565", | 72 "565", |
74 "4444", | 73 "4444", |
75 "8888" | 74 "8888" |
76 }; | 75 }; |
77 | 76 |
78 static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) { | 77 static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) { |
79 SkAutoCanvasRestore acr(canvas, true); | 78 SkAutoCanvasRestore acr(canvas, true); |
80 | 79 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 134 } |
136 | 135 |
137 private: | 136 private: |
138 typedef SampleView INHERITED; | 137 typedef SampleView INHERITED; |
139 }; | 138 }; |
140 | 139 |
141 ////////////////////////////////////////////////////////////////////////////// | 140 ////////////////////////////////////////////////////////////////////////////// |
142 | 141 |
143 static SkView* MyFactory() { return new FilterView; } | 142 static SkView* MyFactory() { return new FilterView; } |
144 static SkViewRegister reg(MyFactory); | 143 static SkViewRegister reg(MyFactory); |
OLD | NEW |