OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 do { | 71 do { |
72 | 72 |
73 SkMatrix matrix; | 73 SkMatrix matrix; |
74 matrix.setScale( curScale, curScale ); | 74 matrix.setScale( curScale, curScale ); |
75 | 75 |
76 SkPaint paint; | 76 SkPaint paint; |
77 paint.setFilterLevel(fFilterLevel); | 77 paint.setFilterLevel(fFilterLevel); |
78 | 78 |
79 canvas->save(); | 79 canvas->save(); |
80 canvas->translate(0, (SkScalar)curY); | 80 canvas->translate(0, (SkScalar)curY); |
81 canvas->drawBitmapMatrix( fBM, matrix, &paint ); | 81 canvas->concat(matrix); |
| 82 canvas->drawBitmap(fBM, 0, 0, &paint); |
82 canvas->restore(); | 83 canvas->restore(); |
83 | 84 |
84 curHeight = (int) (fBM.height() * curScale + 2); | 85 curHeight = (int) (fBM.height() * curScale + 2); |
85 curY += curHeight; | 86 curY += curHeight; |
86 curScale *= 0.75f; | 87 curScale *= 0.75f; |
87 } while (curHeight >= 2 && curY < 4*fBM.height()); | 88 } while (curHeight >= 2 && curY < 4*fBM.height()); |
88 } | 89 } |
89 | 90 |
90 private: | 91 private: |
91 typedef skiagm::GM INHERITED; | 92 typedef skiagm::GM INHERITED; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kLow_FilterL
evel); ) | 208 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kLow_FilterL
evel); ) |
208 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kLow_Fil
terLevel); ) | 209 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kLow_Fil
terLevel); ) |
209 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", | 210 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", |
210 SkPaint::kLow_FilterLevel); ) | 211 SkPaint::kLow_FilterLevel); ) |
211 | 212 |
212 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kNone_FilterLevel); ) | 213 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kNone_FilterLevel); ) |
213 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kNone_Filter
Level); ) | 214 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kNone_Filter
Level); ) |
214 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kNone_Fi
lterLevel); ) | 215 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kNone_Fi
lterLevel); ) |
215 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", | 216 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", |
216 SkPaint::kNone_FilterLevel); ) | 217 SkPaint::kNone_FilterLevel); ) |
OLD | NEW |