| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 const SkScalar h = SkIntToScalar(H); | 218 const SkScalar h = SkIntToScalar(H); |
| 219 SkMatrix m; | 219 SkMatrix m; |
| 220 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); | 220 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); |
| 221 SkShader* s = SkShader::CreateBitmapShader(fBG, | 221 SkShader* s = SkShader::CreateBitmapShader(fBG, |
| 222 SkShader::kRepeat_TileMode, | 222 SkShader::kRepeat_TileMode, |
| 223 SkShader::kRepeat_TileMode, | 223 SkShader::kRepeat_TileMode, |
| 224 &m); | 224 &m); |
| 225 | 225 |
| 226 SkPaint labelP; | 226 SkPaint labelP; |
| 227 labelP.setAntiAlias(true); | 227 labelP.setAntiAlias(true); |
| 228 sk_tool_utils::set_portable_typeface(&labelP); |
| 228 labelP.setTextAlign(SkPaint::kCenter_Align); | 229 labelP.setTextAlign(SkPaint::kCenter_Align); |
| 229 | 230 |
| 230 const int W = 5; | 231 const int W = 5; |
| 231 | 232 |
| 232 SkScalar x0 = 0; | 233 SkScalar x0 = 0; |
| 233 SkScalar y0 = 0; | 234 SkScalar y0 = 0; |
| 234 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) { | 235 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) { |
| 235 SkScalar x = x0, y = y0; | 236 SkScalar x = x0, y = y0; |
| 236 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { | 237 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { |
| 237 if ((gModes[i].fSourceTypeMask & sourceType) == 0) { | 238 if ((gModes[i].fSourceTypeMask & sourceType) == 0) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 private: | 284 private: |
| 284 typedef GM INHERITED; | 285 typedef GM INHERITED; |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 ////////////////////////////////////////////////////////////////////////////// | 288 ////////////////////////////////////////////////////////////////////////////// |
| 288 | 289 |
| 289 static GM* MyFactory(void*) { return new XfermodesGM; } | 290 static GM* MyFactory(void*) { return new XfermodesGM; } |
| 290 static GMRegistry reg(MyFactory); | 291 static GMRegistry reg(MyFactory); |
| 291 | 292 |
| 292 } | 293 } |
| OLD | NEW |