| 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 "SkPath.h" | 10 #include "SkPath.h" |
| 11 | 11 |
| 12 #define STROKE_WIDTH SkIntToScalar(20) | 12 #define STROKE_WIDTH SkIntToScalar(20) |
| 13 | 13 |
| 14 static void draw_path(SkCanvas* canvas, const SkPath& path, const SkRect& rect, | 14 static void draw_path(SkCanvas* canvas, const SkPath& path, const SkRect& rect, |
| 15 SkPaint::Join join, int doFill) { | 15 SkPaint::Join join, int doFill) { |
| 16 SkPaint paint; | 16 SkPaint paint; |
| 17 paint.setAntiAlias(true); | 17 paint.setAntiAlias(true); |
| 18 paint.setStyle(doFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kStroke_Sty
le); | 18 paint.setStyle(doFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kStroke_Sty
le); |
| 19 | 19 |
| 20 paint.setColor(SK_ColorGRAY); | 20 paint.setColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); |
| 21 paint.setStrokeWidth(STROKE_WIDTH); | 21 paint.setStrokeWidth(STROKE_WIDTH); |
| 22 paint.setStrokeJoin(join); | 22 paint.setStrokeJoin(join); |
| 23 canvas->drawRect(rect, paint); | 23 canvas->drawRect(rect, paint); |
| 24 | 24 |
| 25 paint.setStyle(SkPaint::kStroke_Style); | 25 paint.setStyle(SkPaint::kStroke_Style); |
| 26 paint.setStrokeWidth(0); | 26 paint.setStrokeWidth(0); |
| 27 paint.setColor(SK_ColorRED); | 27 paint.setColor(SK_ColorRED); |
| 28 canvas->drawPath(path, paint); | 28 canvas->drawPath(path, paint); |
| 29 | 29 |
| 30 paint.setStrokeWidth(3); | 30 paint.setStrokeWidth(3); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 typedef GM INHERITED; | 108 typedef GM INHERITED; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 111 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 112 | 112 |
| 113 DEF_GM(return new StrokeRectGM;) | 113 DEF_GM(return new StrokeRectGM;) |
| OLD | NEW |