| 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 | 9 |
| 10 #include "Sk2DPathEffect.h" | 10 #include "Sk2DPathEffect.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void onOnceBeforeDraw() override { | 141 void onOnceBeforeDraw() override { |
| 142 SkTextBlobBuilder builder; | 142 SkTextBlobBuilder builder; |
| 143 | 143 |
| 144 // LCD | 144 // LCD |
| 145 SkPaint paint; | 145 SkPaint paint; |
| 146 paint.setTextSize(32); | 146 paint.setTextSize(32); |
| 147 const char* text = "The quick brown fox jumps over the lazy dog"; | 147 const char* text = "The quick brown fox jumps over the lazy dog"; |
| 148 paint.setSubpixelText(true); | 148 paint.setSubpixelText(true); |
| 149 paint.setLCDRenderText(true); | 149 paint.setLCDRenderText(true); |
| 150 paint.setAntiAlias(true); | 150 paint.setAntiAlias(true); |
| 151 sk_tool_utils::set_portable_typeface(&paint); |
| 151 add_to_text_blob(&builder, text, paint, 0, 0); | 152 add_to_text_blob(&builder, text, paint, 0, 0); |
| 152 fBlob.reset(builder.build()); | 153 fBlob.reset(builder.build()); |
| 153 | 154 |
| 154 // create a looper which sandwhiches an effect in two normal draws | 155 // create a looper which sandwhiches an effect in two normal draws |
| 155 LooperSettings looperSandwhich[] = { | 156 LooperSettings looperSandwhich[] = { |
| 156 { SkXfermode::kSrc_Mode, SK_ColorMAGENTA, SkPaint::kFill_Style, 0, 0,
0, false }, | 157 { SkXfermode::kSrc_Mode, SK_ColorMAGENTA, SkPaint::kFill_Style, 0, 0,
0, false }, |
| 157 { SkXfermode::kSrcOver_Mode, 0x88000000, SkPaint::kFill_Style, 0, 10.
f, 0, true }, | 158 { SkXfermode::kSrcOver_Mode, 0x88000000, SkPaint::kFill_Style, 0, 10.
f, 0, true }, |
| 158 { SkXfermode::kSrcOver_Mode, 0x50FF00FF, SkPaint::kFill_Style, 0, 20.
f, 0, false }, | 159 { SkXfermode::kSrcOver_Mode, 0x50FF00FF, SkPaint::kFill_Style, 0, 20.
f, 0, false }, |
| 159 }; | 160 }; |
| 160 | 161 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 SkAutoTUnref<const SkTextBlob> fBlob; | 250 SkAutoTUnref<const SkTextBlob> fBlob; |
| 250 SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers; | 251 SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers; |
| 251 | 252 |
| 252 typedef GM INHERITED; | 253 typedef GM INHERITED; |
| 253 }; | 254 }; |
| 254 | 255 |
| 255 ////////////////////////////////////////////////////////////////////////////// | 256 ////////////////////////////////////////////////////////////////////////////// |
| 256 | 257 |
| 257 DEF_GM( return SkNEW(TextBlobLooperGM); ) | 258 DEF_GM( return SkNEW(TextBlobLooperGM); ) |
| 258 } | 259 } |
| OLD | NEW |