| 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 #include "SkPaint.h" | 9 #include "SkPaint.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 path.fPath.moveTo(25*SK_Scalar1, 10*SK_Scalar1); | 273 path.fPath.moveTo(25*SK_Scalar1, 10*SK_Scalar1); |
| 274 path.fPath.cubicTo(40*SK_Scalar1, 20*SK_Scalar1, | 274 path.fPath.cubicTo(40*SK_Scalar1, 20*SK_Scalar1, |
| 275 60*SK_Scalar1, 20*SK_Scalar1, | 275 60*SK_Scalar1, 20*SK_Scalar1, |
| 276 75*SK_Scalar1, 10*SK_Scalar1); | 276 75*SK_Scalar1, 10*SK_Scalar1); |
| 277 path.fPath.close(); | 277 path.fPath.close(); |
| 278 path.fName = "moveTo-cubic-close"; | 278 path.fName = "moveTo-cubic-close"; |
| 279 | 279 |
| 280 SkPaint titlePaint; | 280 SkPaint titlePaint; |
| 281 titlePaint.setColor(SK_ColorBLACK); | 281 titlePaint.setColor(SK_ColorBLACK); |
| 282 titlePaint.setAntiAlias(true); | 282 titlePaint.setAntiAlias(true); |
| 283 sk_tool_utils::set_portable_typeface(&titlePaint); |
| 283 titlePaint.setLCDRenderText(true); | 284 titlePaint.setLCDRenderText(true); |
| 284 titlePaint.setTextSize(15 * SK_Scalar1); | 285 titlePaint.setTextSize(15 * SK_Scalar1); |
| 285 const char title[] = "Cubic Closed Drawn Into Rectangle Clips With " | 286 const char title[] = "Cubic Closed Drawn Into Rectangle Clips With " |
| 286 "Indicated Style, Fill and Linecaps, with stroke wi
dth 10"; | 287 "Indicated Style, Fill and Linecaps, with stroke wi
dth 10"; |
| 287 canvas->drawText(title, strlen(title), | 288 canvas->drawText(title, strlen(title), |
| 288 20 * SK_Scalar1, | 289 20 * SK_Scalar1, |
| 289 20 * SK_Scalar1, | 290 20 * SK_Scalar1, |
| 290 titlePaint); | 291 titlePaint); |
| 291 | 292 |
| 292 SkLCGRandom rand; | 293 SkLCGRandom rand; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 317 SkPaint rectPaint; | 318 SkPaint rectPaint; |
| 318 rectPaint.setColor(SK_ColorBLACK); | 319 rectPaint.setColor(SK_ColorBLACK); |
| 319 rectPaint.setStyle(SkPaint::kStroke_Style); | 320 rectPaint.setStyle(SkPaint::kStroke_Style); |
| 320 rectPaint.setStrokeWidth(-1); | 321 rectPaint.setStrokeWidth(-1); |
| 321 rectPaint.setAntiAlias(true); | 322 rectPaint.setAntiAlias(true); |
| 322 canvas->drawRect(rect, rectPaint); | 323 canvas->drawRect(rect, rectPaint); |
| 323 | 324 |
| 324 SkPaint labelPaint; | 325 SkPaint labelPaint; |
| 325 labelPaint.setColor(color); | 326 labelPaint.setColor(color); |
| 326 labelPaint.setAntiAlias(true); | 327 labelPaint.setAntiAlias(true); |
| 328 sk_tool_utils::set_portable_typeface(&labelPaint); |
| 327 labelPaint.setLCDRenderText(true); | 329 labelPaint.setLCDRenderText(true); |
| 328 labelPaint.setTextSize(10 * SK_Scalar1); | 330 labelPaint.setTextSize(10 * SK_Scalar1); |
| 329 canvas->drawText(gStyles[style].fName, | 331 canvas->drawText(gStyles[style].fName, |
| 330 strlen(gStyles[style].fName), | 332 strlen(gStyles[style].fName), |
| 331 0, rect.height() + 12 * SK_Scalar1, | 333 0, rect.height() + 12 * SK_Scalar1, |
| 332 labelPaint); | 334 labelPaint); |
| 333 canvas->drawText(gFills[fill].fName, | 335 canvas->drawText(gFills[fill].fName, |
| 334 strlen(gFills[fill].fName), | 336 strlen(gFills[fill].fName), |
| 335 0, rect.height() + 24 * SK_Scalar1, | 337 0, rect.height() + 24 * SK_Scalar1, |
| 336 labelPaint); | 338 labelPaint); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 349 | 351 |
| 350 private: | 352 private: |
| 351 typedef skiagm::GM INHERITED; | 353 typedef skiagm::GM INHERITED; |
| 352 }; | 354 }; |
| 353 | 355 |
| 354 ////////////////////////////////////////////////////////////////////////////// | 356 ////////////////////////////////////////////////////////////////////////////// |
| 355 | 357 |
| 356 DEF_GM( return new CubicPathGM; ) | 358 DEF_GM( return new CubicPathGM; ) |
| 357 DEF_GM( return new CubicClosePathGM; ) | 359 DEF_GM( return new CubicClosePathGM; ) |
| 358 DEF_GM( return new ClippedCubicGM; ) | 360 DEF_GM( return new ClippedCubicGM; ) |
| OLD | NEW |