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 "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 canvas->save(); | 154 canvas->save(); |
155 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); ++i) { | 155 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); ++i) { |
156 if (6 == i) { | 156 if (6 == i) { |
157 canvas->restore(); | 157 canvas->restore(); |
158 canvas->translate(W * 5, 0); | 158 canvas->translate(W * 5, 0); |
159 canvas->save(); | 159 canvas->save(); |
160 } | 160 } |
161 SkXfermode* mode = SkXfermode::Create(gModes[i].fMode); | 161 SkXfermode* mode = SkXfermode::Create(gModes[i].fMode); |
162 | 162 |
163 canvas->drawRect(bounds, fBGPaint); | 163 canvas->drawRect(bounds, fBGPaint); |
164 canvas->saveLayer(&bounds, NULL); | 164 canvas->saveLayer(&bounds, nullptr); |
165 SkScalar dy = drawCell(canvas, mode, | 165 SkScalar dy = drawCell(canvas, mode, |
166 gAlphaValue[alpha & 1], | 166 gAlphaValue[alpha & 1], |
167 gAlphaValue[alpha & 2]); | 167 gAlphaValue[alpha & 2]); |
168 canvas->restore(); | 168 canvas->restore(); |
169 | 169 |
170 canvas->translate(0, dy * 5 / 4); | 170 canvas->translate(0, dy * 5 / 4); |
171 SkSafeUnref(mode); | 171 SkSafeUnref(mode); |
172 } | 172 } |
173 canvas->restore(); | 173 canvas->restore(); |
174 canvas->restore(); | 174 canvas->restore(); |
175 canvas->translate(W * 5 / 4, 0); | 175 canvas->translate(W * 5 / 4, 0); |
176 } | 176 } |
177 } | 177 } |
178 | 178 |
179 private: | 179 private: |
180 typedef GM INHERITED; | 180 typedef GM INHERITED; |
181 }; | 181 }; |
182 | 182 |
183 ////////////////////////////////////////////////////////////////////////////// | 183 ////////////////////////////////////////////////////////////////////////////// |
184 | 184 |
185 static GM* MyFactory(void*) { return new AARectModesGM; } | 185 static GM* MyFactory(void*) { return new AARectModesGM; } |
186 static GMRegistry reg(MyFactory); | 186 static GMRegistry reg(MyFactory); |
187 | 187 |
188 } | 188 } |
OLD | NEW |