| 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkShader.h" | 9 #include "SkShader.h" |
| 10 #include "SkXfermode.h" | 10 #include "SkXfermode.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 x += w + SkIntToScalar(10); | 77 x += w + SkIntToScalar(10); |
| 78 if ((m % W) == W - 1) { | 78 if ((m % W) == W - 1) { |
| 79 x = 0; | 79 x = 0; |
| 80 y += h + SkIntToScalar(30); | 80 y += h + SkIntToScalar(30); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 void onOnceBeforeDraw() override { | 86 void onOnceBeforeDraw() override { |
| 87 static const uint32_t kCheckData[] = { | 87 const uint32_t kCheckData[] = { |
| 88 SkPackARGB32(0xFF, 0x42, 0x41, 0x42), | 88 SkPackARGB32(0xFF, 0x42, 0x41, 0x42), |
| 89 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), | 89 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), |
| 90 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), | 90 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), |
| 91 SkPackARGB32(0xFF, 0x42, 0x41, 0x42) | 91 SkPackARGB32(0xFF, 0x42, 0x41, 0x42) |
| 92 }; | 92 }; |
| 93 SkBitmap bg; | 93 SkBitmap bg; |
| 94 bg.allocN32Pixels(2, 2, true); | 94 bg.allocN32Pixels(2, 2, true); |
| 95 memcpy(bg.getPixels(), kCheckData, sizeof(kCheckData)); | 95 memcpy(bg.getPixels(), kCheckData, sizeof(kCheckData)); |
| 96 | 96 |
| 97 SkMatrix lm; | 97 SkMatrix lm; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 typedef GM INHERITED; | 139 typedef GM INHERITED; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 ////////////////////////////////////////////////////////////////////////////// | 142 ////////////////////////////////////////////////////////////////////////////// |
| 143 | 143 |
| 144 static GM* MyFactory(void*) { return new Xfermodes2GM; } | 144 static GM* MyFactory(void*) { return new Xfermodes2GM; } |
| 145 static GMRegistry reg(MyFactory); | 145 static GMRegistry reg(MyFactory); |
| 146 | 146 |
| 147 } | 147 } |
| OLD | NEW |