| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 SkRect srcR = { | 205 SkRect srcR = { |
| 206 0, 0, SkIntToScalar(srcBM.width()), SkIntToScalar(srcBM.height()) }; | 206 0, 0, SkIntToScalar(srcBM.width()), SkIntToScalar(srcBM.height()) }; |
| 207 | 207 |
| 208 // cons up a mesh to draw the bitmap with | 208 // cons up a mesh to draw the bitmap with |
| 209 Mesh mesh(srcBM, &paint); | 209 Mesh mesh(srcBM, &paint); |
| 210 | 210 |
| 211 SkImageInfo info = SkImageInfo::Make(W, H, kUnknown_SkColorType, | 211 SkImageInfo info = SkImageInfo::Make(W, H, kUnknown_SkColorType, |
| 212 kPremul_SkAlphaType); | 212 kPremul_SkAlphaType); |
| 213 | 213 |
| 214 for (size_t i = 0; i < SK_ARRAY_COUNT(gDstColorType); i++) { | 214 for (size_t i = 0; i < SK_ARRAY_COUNT(gDstColorType); i++) { |
| 215 info.fColorType = gDstColorType[i]; | 215 info = info.makeColorType(gDstColorType[i]); |
| 216 | 216 |
| 217 SkBitmap dstBM0, dstBM1; | 217 SkBitmap dstBM0, dstBM1; |
| 218 dstBM0.allocPixels(info); | 218 dstBM0.allocPixels(info); |
| 219 dstBM1.allocPixels(info); | 219 dstBM1.allocPixels(info); |
| 220 | 220 |
| 221 SkCanvas canvas0(dstBM0); | 221 SkCanvas canvas0(dstBM0); |
| 222 SkCanvas canvas1(dstBM1); | 222 SkCanvas canvas1(dstBM1); |
| 223 SkColor bgColor; | 223 SkColor bgColor; |
| 224 | 224 |
| 225 for (size_t j = 0; j < SK_ARRAY_COUNT(gDstBG); j++) { | 225 for (size_t j = 0; j < SK_ARRAY_COUNT(gDstBG); j++) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 DEF_TEST(BlitRow, reporter) { | 261 DEF_TEST(BlitRow, reporter) { |
| 262 test_00_FF(reporter); | 262 test_00_FF(reporter); |
| 263 test_diagonal(reporter); | 263 test_diagonal(reporter); |
| 264 } | 264 } |
| OLD | NEW |