| 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 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } else { | 77 } else { |
| 78 rowColor = 0; | 78 rowColor = 0; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 return bitmap; | 81 return bitmap; |
| 82 } | 82 } |
| 83 | 83 |
| 84 static SkBitmap make_argb4444_stripes() { | 84 static SkBitmap make_argb4444_stripes() { |
| 85 SkBitmap bitmap; | 85 SkBitmap bitmap; |
| 86 init_bitmap(kARGB_4444_SkColorType, &bitmap); | 86 init_bitmap(kARGB_4444_SkColorType, &bitmap); |
| 87 uint8_t rowColor = 0;; | 87 uint8_t rowColor = 0; |
| 88 for (int y = 0; y < SLIDE_SIZE; y++) { | 88 for (int y = 0; y < SLIDE_SIZE; y++) { |
| 89 uint16_t* dst = bitmap.getAddr16(0, y); | 89 uint16_t* dst = bitmap.getAddr16(0, y); |
| 90 for (int x = 0; x < SLIDE_SIZE; x++) { | 90 for (int x = 0; x < SLIDE_SIZE; x++) { |
| 91 dst[x] = SkPackARGB4444(rowColor, rowColor, | 91 dst[x] = SkPackARGB4444(rowColor, rowColor, |
| 92 rowColor, rowColor); | 92 rowColor, rowColor); |
| 93 } | 93 } |
| 94 if (rowColor == 0) { | 94 if (rowColor == 0) { |
| 95 rowColor = 15; | 95 rowColor = 15; |
| 96 } else { | 96 } else { |
| 97 rowColor = 0; | 97 rowColor = 0; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 124 canvas->drawBitmap(make_argb8888_stripes(), 0, slideSize); | 124 canvas->drawBitmap(make_argb8888_stripes(), 0, slideSize); |
| 125 canvas->drawBitmap(make_argb4444_stripes(), slideSize, slideSize); | 125 canvas->drawBitmap(make_argb4444_stripes(), slideSize, slideSize); |
| 126 } | 126 } |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 typedef GM INHERITED; | 129 typedef GM INHERITED; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 DEF_GM( return new BitmapPremulGM; ) | 132 DEF_GM( return new BitmapPremulGM; ) |
| 133 } | 133 } |
| OLD | NEW |