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 "SkRect.h" | 9 #include "SkRect.h" |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 for (int i = 0; i < coords.length; ++i) | 181 for (int i = 0; i < coords.length; ++i) |
182 setPixel(coords[i]->fX, coords[i]->fY, i, bm); | 182 setPixel(coords[i]->fX, coords[i]->fY, i, bm); |
183 } | 183 } |
184 | 184 |
185 static const Pair gPairs[] = { | 185 static const Pair gPairs[] = { |
186 { kUnknown_SkColorType, "000000" }, | 186 { kUnknown_SkColorType, "000000" }, |
187 { kAlpha_8_SkColorType, "010101" }, | 187 { kAlpha_8_SkColorType, "010101" }, |
188 { kIndex_8_SkColorType, "011101" }, | 188 { kIndex_8_SkColorType, "011101" }, |
189 { kRGB_565_SkColorType, "010101" }, | 189 { kRGB_565_SkColorType, "010101" }, |
190 { kARGB_4444_SkColorType, "010111" }, | 190 { kARGB_4444_SkColorType, "010111" }, |
191 { kN32_SkColorType, "010111" }, | 191 { kPMColor_SkColorType, "010111" }, |
192 }; | 192 }; |
193 | 193 |
194 static const int W = 20; | 194 static const int W = 20; |
195 static const int H = 33; | 195 static const int H = 33; |
196 | 196 |
197 static void setup_src_bitmaps(SkBitmap* srcOpaque, SkBitmap* srcPremul, | 197 static void setup_src_bitmaps(SkBitmap* srcOpaque, SkBitmap* srcPremul, |
198 SkColorType ct) { | 198 SkColorType ct) { |
199 SkColorTable* ctOpaque = NULL; | 199 SkColorTable* ctOpaque = NULL; |
200 SkColorTable* ctPremul = NULL; | 200 SkColorTable* ctPremul = NULL; |
201 if (kIndex_8_SkColorType == ct) { | 201 if (kIndex_8_SkColorType == ct) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 break; | 358 break; |
359 | 359 |
360 case kRGB_565_SkColorType: | 360 case kRGB_565_SkColorType: |
361 case kARGB_4444_SkColorType: | 361 case kARGB_4444_SkColorType: |
362 if (safeSize != 0x470DE4DF820000LL) { | 362 if (safeSize != 0x470DE4DF820000LL) { |
363 sizeFail = true; | 363 sizeFail = true; |
364 } | 364 } |
365 break; | 365 break; |
366 | 366 |
367 case kN32_SkColorType: | 367 case kPMColor_SkColorType: |
368 if (safeSize != 0x8E1BC9BF040000LL) { | 368 if (safeSize != 0x8E1BC9BF040000LL) { |
369 sizeFail = true; | 369 sizeFail = true; |
370 } | 370 } |
371 break; | 371 break; |
372 | 372 |
373 default: | 373 default: |
374 break; | 374 break; |
375 } | 375 } |
376 if (sizeFail) { | 376 if (sizeFail) { |
377 ERRORF(reporter, "computeSafeSize64() wrong size: %s", | 377 ERRORF(reporter, "computeSafeSize64() wrong size: %s", |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 // for the transfer. | 536 // for the transfer. |
537 REPORTER_ASSERT(reporter, | 537 REPORTER_ASSERT(reporter, |
538 subset.copyPixelsFrom(buf, 1, subset.rowBytes()) == | 538 subset.copyPixelsFrom(buf, 1, subset.rowBytes()) == |
539 false); | 539 false); |
540 | 540 |
541 #endif | 541 #endif |
542 } | 542 } |
543 } // for (size_t copyCase ... | 543 } // for (size_t copyCase ... |
544 } | 544 } |
545 } | 545 } |
OLD | NEW |