| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 SkShader::kRepeat_TileMode); | 52 SkShader::kRepeat_TileMode); |
| 53 paint->setShader(s)->unref(); | 53 paint->setShader(s)->unref(); |
| 54 canvas->drawRect(SkRect::MakeWH(w, h), *paint); | 54 canvas->drawRect(SkRect::MakeWH(w, h), *paint); |
| 55 paint->setShader(NULL); | 55 paint->setShader(NULL); |
| 56 return w * 5/4; | 56 return w * 5/4; |
| 57 #endif | 57 #endif |
| 58 } | 58 } |
| 59 | 59 |
| 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->setFilterBitmap(true); | 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", | 70 "A1", |
| 71 "A8", | 71 "A8", |
| 72 "Index8", | 72 "Index8", |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 typedef SampleView INHERITED; | 138 typedef SampleView INHERITED; |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 ////////////////////////////////////////////////////////////////////////////// | 141 ////////////////////////////////////////////////////////////////////////////// |
| 142 | 142 |
| 143 static SkView* MyFactory() { return new FilterView; } | 143 static SkView* MyFactory() { return new FilterView; } |
| 144 static SkViewRegister reg(MyFactory); | 144 static SkViewRegister reg(MyFactory); |
| OLD | NEW |