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 | 9 |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat,
SkScalar dx) { | 38 static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat,
SkScalar dx) { |
39 draw_cell(canvas, bm, mat, 0 * dx, SkPaint::kNone_FilterLevel); | 39 draw_cell(canvas, bm, mat, 0 * dx, SkPaint::kNone_FilterLevel); |
40 draw_cell(canvas, bm, mat, 1 * dx, SkPaint::kLow_FilterLevel); | 40 draw_cell(canvas, bm, mat, 1 * dx, SkPaint::kLow_FilterLevel); |
41 draw_cell(canvas, bm, mat, 2 * dx, SkPaint::kMedium_FilterLevel); | 41 draw_cell(canvas, bm, mat, 2 * dx, SkPaint::kMedium_FilterLevel); |
42 draw_cell(canvas, bm, mat, 3 * dx, SkPaint::kHigh_FilterLevel); | 42 draw_cell(canvas, bm, mat, 3 * dx, SkPaint::kHigh_FilterLevel); |
43 } | 43 } |
44 | 44 |
45 class FilterBitmapGM : public skiagm::GM { | 45 class FilterBitmapGM : public skiagm::GM { |
46 void onOnceBeforeDraw() { | 46 void onOnceBeforeDraw() SK_OVERRIDE { |
47 | 47 |
48 this->makeBitmap(); | 48 this->makeBitmap(); |
49 | 49 |
50 SkScalar cx = SkScalarHalf(fBM.width()); | 50 SkScalar cx = SkScalarHalf(fBM.width()); |
51 SkScalar cy = SkScalarHalf(fBM.height()); | 51 SkScalar cy = SkScalarHalf(fBM.height()); |
52 SkScalar scale = this->getScale(); | 52 SkScalar scale = this->getScale(); |
53 | 53 |
54 // these two matrices use a scale factor configured by the subclass | 54 // these two matrices use a scale factor configured by the subclass |
55 fMatrix[0].setScale(scale, scale); | 55 fMatrix[0].setScale(scale, scale); |
56 fMatrix[1].setRotate(30, cx, cy); fMatrix[1].postScale(scale, scale); | 56 fMatrix[1].setRotate(30, cx, cy); fMatrix[1].postScale(scale, scale); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) | 222 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) |
223 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) | 223 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) |
224 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) | 224 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) |
225 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) | 225 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) |
226 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) | 226 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) |
227 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) | 227 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) |
228 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) | 228 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) |
229 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) | 229 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) |
230 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) | 230 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) |
231 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) | 231 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) |
OLD | NEW |