| 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkShader.h" | 10 #include "SkShader.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 labelP.setTextAlign(SkPaint::kCenter_Align); | 272 labelP.setTextAlign(SkPaint::kCenter_Align); |
| 273 | 273 |
| 274 const int W = 5; | 274 const int W = 5; |
| 275 | 275 |
| 276 SkScalar x0 = 0; | 276 SkScalar x0 = 0; |
| 277 SkScalar y0 = 0; | 277 SkScalar y0 = 0; |
| 278 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) { | 278 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) { |
| 279 SkScalar x = x0, y = y0; | 279 SkScalar x = x0, y = y0; |
| 280 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { | 280 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { |
| 281 if ((gModes[i].fSourceTypeMask & sourceType) == 0) { | 281 if ((gModes[i].fSourceTypeMask & sourceType) == 0) { |
| 282 SkDebugf("skip %d %s for type %x\n", i, gModes[i].fLabel, so
urceType); | |
| 283 continue; | 282 continue; |
| 284 } | 283 } |
| 285 SkAutoTUnref<SkXfermode> mode; | 284 SkAutoTUnref<SkXfermode> mode; |
| 286 if (gModes[i].fSourceTypeMask & kCustomMask) { | 285 if (gModes[i].fSourceTypeMask & kCustomMask) { |
| 287 mode.reset(make_custom(gModes[i].fSourceTypeMask & kCustomMa
sk)); | 286 mode.reset(make_custom(gModes[i].fSourceTypeMask & kCustomMa
sk)); |
| 288 } else { | 287 } else { |
| 289 mode.reset(SkXfermode::Create(gModes[i].fMode)); | 288 mode.reset(SkXfermode::Create(gModes[i].fMode)); |
| 290 } | 289 } |
| 291 SkRect r; | 290 SkRect r; |
| 292 r.set(x, y, x+w, y+h); | 291 r.set(x, y, x+w, y+h); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 y0 = 0; | 325 y0 = 0; |
| 327 } | 326 } |
| 328 } | 327 } |
| 329 s->unref(); | 328 s->unref(); |
| 330 } | 329 } |
| 331 | 330 |
| 332 private: | 331 private: |
| 333 typedef GM INHERITED; | 332 typedef GM INHERITED; |
| 334 }; | 333 }; |
| 335 DEF_GM( return new XfermodesGM; ) | 334 DEF_GM( return new XfermodesGM; ) |
| OLD | NEW |