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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 { SkXfermode::kColorDodge_Mode, "ColorDodge" }, | 144 { SkXfermode::kColorDodge_Mode, "ColorDodge" }, |
145 { SkXfermode::kColorBurn_Mode, "ColorBurn" }, | 145 { SkXfermode::kColorBurn_Mode, "ColorBurn" }, |
146 { SkXfermode::kHardLight_Mode, "HardLight" }, | 146 { SkXfermode::kHardLight_Mode, "HardLight" }, |
147 { SkXfermode::kSoftLight_Mode, "SoftLight" }, | 147 { SkXfermode::kSoftLight_Mode, "SoftLight" }, |
148 { SkXfermode::kDifference_Mode, "Difference" }, | 148 { SkXfermode::kDifference_Mode, "Difference" }, |
149 { SkXfermode::kExclusion_Mode, "Exclusion" },*/ | 149 { SkXfermode::kExclusion_Mode, "Exclusion" },*/ |
150 }; | 150 }; |
151 | 151 |
152 const SkScalar w = SkIntToScalar(W); | 152 const SkScalar w = SkIntToScalar(W); |
153 const SkScalar h = SkIntToScalar(H); | 153 const SkScalar h = SkIntToScalar(H); |
| 154 SkMatrix m; |
| 155 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); |
154 SkShader* s = SkShader::CreateBitmapShader(fBG, | 156 SkShader* s = SkShader::CreateBitmapShader(fBG, |
155 SkShader::kRepeat_TileMode, | 157 SkShader::kRepeat_TileMode, |
156 SkShader::kRepeat_TileMode); | 158 SkShader::kRepeat_TileMode, |
157 SkMatrix m; | 159 &m); |
158 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); | |
159 s->setLocalMatrix(m); | |
160 | 160 |
161 SkPaint labelP; | 161 SkPaint labelP; |
162 labelP.setAntiAlias(true); | 162 labelP.setAntiAlias(true); |
163 labelP.setLCDRenderText(true); | 163 labelP.setLCDRenderText(true); |
164 labelP.setTextAlign(SkPaint::kCenter_Align); | 164 labelP.setTextAlign(SkPaint::kCenter_Align); |
165 setNamedTypeface(&labelP, "Menlo Regular"); | 165 setNamedTypeface(&labelP, "Menlo Regular"); |
166 | 166 |
167 const int W = 5; | 167 const int W = 5; |
168 | 168 |
169 SkScalar x0 = 0; | 169 SkScalar x0 = 0; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 } | 203 } |
204 | 204 |
205 private: | 205 private: |
206 typedef SampleView INHERITED; | 206 typedef SampleView INHERITED; |
207 }; | 207 }; |
208 | 208 |
209 ////////////////////////////////////////////////////////////////////////////// | 209 ////////////////////////////////////////////////////////////////////////////// |
210 | 210 |
211 static SkView* MyFactory() { return new XfermodesBlurView; } | 211 static SkView* MyFactory() { return new XfermodesBlurView; } |
212 static SkViewRegister reg(MyFactory); | 212 static SkViewRegister reg(MyFactory); |
OLD | NEW |