| 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 "sk_tool_utils.h" | 9 #include "sk_tool_utils.h" |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm, | 35 static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm, |
| 36 SkScalar x, SkScalar y, SkPaint* paint) { | 36 SkScalar x, SkScalar y, SkPaint* paint) { |
| 37 canvas->drawBitmap(bm, x, y, paint); | 37 canvas->drawBitmap(bm, x, y, paint); |
| 38 return SkIntToScalar(bm.width()) * 5/4; | 38 return SkIntToScalar(bm.width()) * 5/4; |
| 39 } | 39 } |
| 40 | 40 |
| 41 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, | 41 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, |
| 42 SkPaint* p) { | 42 SkPaint* p) { |
| 43 x += draw_bm(c, bm, x, 0, p); | 43 x += draw_bm(c, bm, x, 0, p); |
| 44 p->setFilterLevel(SkPaint::kLow_FilterLevel); | 44 p->setFilterQuality(kLow_SkFilterQuality); |
| 45 x += draw_bm(c, bm, x, 0, p); | 45 x += draw_bm(c, bm, x, 0, p); |
| 46 p->setDither(true); | 46 p->setDither(true); |
| 47 return x + draw_bm(c, bm, x, 0, p); | 47 return x + draw_bm(c, bm, x, 0, p); |
| 48 } | 48 } |
| 49 | 49 |
| 50 static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) { | 50 static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) { |
| 51 SkAutoCanvasRestore acr(canvas, true); | 51 SkAutoCanvasRestore acr(canvas, true); |
| 52 | 52 |
| 53 SkPaint paint; | 53 SkPaint paint; |
| 54 SkScalar x = 0; | 54 SkScalar x = 0; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 private: | 117 private: |
| 118 typedef GM INHERITED; | 118 typedef GM INHERITED; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 ////////////////////////////////////////////////////////////////////////////// | 121 ////////////////////////////////////////////////////////////////////////////// |
| 122 | 122 |
| 123 static GM* MyFactory(void*) { return new FilterGM; } | 123 static GM* MyFactory(void*) { return new FilterGM; } |
| 124 static GMRegistry reg(MyFactory); | 124 static GMRegistry reg(MyFactory); |
| 125 | 125 |
| 126 } | 126 } |
| OLD | NEW |