| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
| 10 #include "SkShader.h" | 10 #include "SkShader.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 SkPaint paint; | 41 SkPaint paint; |
| 42 paint.setAntiAlias(true); | 42 paint.setAntiAlias(true); |
| 43 paint.setShader(s)->unref(); | 43 paint.setShader(s)->unref(); |
| 44 | 44 |
| 45 SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif", | 45 SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif", |
| 46 SkTypeface::kBold); | 46 SkTypeface::kBold); |
| 47 if (NULL == orig) { | 47 if (NULL == orig) { |
| 48 orig = SkTypeface::RefDefault(); | 48 orig = SkTypeface::RefDefault(); |
| 49 } | 49 } |
| 50 fColorType = SkNEW_ARGS(SkGTypeface, (orig, paint)); | 50 fColorType = new SkGTypeface(orig, paint); |
| 51 orig->unref(); | 51 orig->unref(); |
| 52 | 52 |
| 53 fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, | 53 fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, |
| 54 kOpaque_SkAlphaType), gData, 4); | 54 kOpaque_SkAlphaType), gData, 4); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual SkString onShortName() override { | 57 virtual SkString onShortName() override { |
| 58 return SkString("colortype_xfermodes"); | 58 return SkString("colortype_xfermodes"); |
| 59 } | 59 } |
| 60 | 60 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 typedef GM INHERITED; | 163 typedef GM INHERITED; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 ////////////////////////////////////////////////////////////////////////////// | 166 ////////////////////////////////////////////////////////////////////////////// |
| 167 | 167 |
| 168 static GM* MyFactory(void*) { return new ColorTypeXfermodeGM; } | 168 static GM* MyFactory(void*) { return new ColorTypeXfermodeGM; } |
| 169 static GMRegistry reg(MyFactory); | 169 static GMRegistry reg(MyFactory); |
| 170 | 170 |
| 171 } | 171 } |
| OLD | NEW |