OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkShader.h" | 10 #include "SkShader.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 fShader.reset(SkShader::CreateBitmapShader(fTexture, | 76 fShader.reset(SkShader::CreateBitmapShader(fTexture, |
77 SkShader::kRepeat_TileMode, | 77 SkShader::kRepeat_TileMode, |
78 SkShader::kRepeat_TileMode)); | 78 SkShader::kRepeat_TileMode)); |
79 } | 79 } |
80 | 80 |
81 void createMaskFilter() { | 81 void createMaskFilter() { |
82 if (NULL != fMaskFilter.get()) { | 82 if (NULL != fMaskFilter.get()) { |
83 return; | 83 return; |
84 } | 84 } |
85 | 85 |
86 fMaskFilter.reset(SkNEW(SkStippleMaskFilter)); | 86 fMaskFilter.reset(SkStippleMaskFilter::Create()); |
87 } | 87 } |
88 | 88 |
89 virtual void onDraw(SkCanvas* canvas) { | 89 virtual void onDraw(SkCanvas* canvas) { |
90 | 90 |
91 createShader(); | 91 createShader(); |
92 createMaskFilter(); | 92 createMaskFilter(); |
93 | 93 |
94 canvas->save(); | 94 canvas->save(); |
95 | 95 |
96 // draw a letter "M" with a green & red striped texture and a | 96 // draw a letter "M" with a green & red striped texture and a |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 typedef GM INHERITED; | 144 typedef GM INHERITED; |
145 }; | 145 }; |
146 | 146 |
147 ////////////////////////////////////////////////////////////////////////////// | 147 ////////////////////////////////////////////////////////////////////////////// |
148 | 148 |
149 static GM* MyFactory(void*) { return new SamplerStressGM; } | 149 static GM* MyFactory(void*) { return new SamplerStressGM; } |
150 static GMRegistry reg(MyFactory); | 150 static GMRegistry reg(MyFactory); |
151 | 151 |
152 } | 152 } |
OLD | NEW |