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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkMathPriv.h" | 10 #include "SkMathPriv.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 break; | 45 break; |
46 case 4: | 46 case 4: |
47 a = 0x01; | 47 a = 0x01; |
48 break; | 48 break; |
49 case 3: | 49 case 3: |
50 a = 0x00; | 50 a = 0x00; |
51 break; | 51 break; |
52 } | 52 } |
53 return SkPremultiplyARGBInline(a, r, g, b); | 53 return SkPremultiplyARGBInline(a, r, g, b); |
54 } | 54 } |
55 | 55 |
56 static SkPMColor get_dst_bmp_init_color(int x, int y, int w) { | 56 static SkPMColor get_dst_bmp_init_color(int x, int y, int w) { |
57 int n = y * w + x; | 57 int n = y * w + x; |
58 | 58 |
59 U8CPU b = n & 0xff; | 59 U8CPU b = n & 0xff; |
60 U8CPU g = (n >> 8) & 0xff; | 60 U8CPU g = (n >> 8) & 0xff; |
61 U8CPU r = (n >> 16) & 0xff; | 61 U8CPU r = (n >> 16) & 0xff; |
62 return SkPackARGB32(0xff, r, g , b); | 62 return SkPackARGB32(0xff, r, g , b); |
63 } | 63 } |
64 | 64 |
65 static SkPMColor convert_to_pmcolor(SkColorType ct, SkAlphaType at, const uint32
_t* addr, | 65 static SkPMColor convert_to_pmcolor(SkColorType ct, SkAlphaType at, const uint32
_t* addr, |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 SkAutoTUnref<SkData> dataB(draw_into_surface(surfB.get(), tx_subset, qua
lity)); | 617 SkAutoTUnref<SkData> dataB(draw_into_surface(surfB.get(), tx_subset, qua
lity)); |
618 | 618 |
619 REPORTER_ASSERT(reporter, dataA->equals(dataB)); | 619 REPORTER_ASSERT(reporter, dataA->equals(dataB)); |
620 if (false) { | 620 if (false) { |
621 dump_to_file("test_image_A.png", dataA); | 621 dump_to_file("test_image_A.png", dataA); |
622 dump_to_file("test_image_B.png", dataB); | 622 dump_to_file("test_image_B.png", dataB); |
623 } | 623 } |
624 } | 624 } |
625 } | 625 } |
626 #endif | 626 #endif |
OLD | NEW |