| 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" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 static const SkRect gRects[] = { | 72 static const SkRect gRects[] = { |
| 73 { 0, 0, W, H }, | 73 { 0, 0, W, H }, |
| 74 { W, 0, 0, H }, | 74 { W, 0, 0, H }, |
| 75 { 0, H, W, 0 }, | 75 { 0, H, W, 0 }, |
| 76 { 0, 0, STROKE_WIDTH, H }, | 76 { 0, 0, STROKE_WIDTH, H }, |
| 77 { 0, 0, W, STROKE_WIDTH }, | 77 { 0, 0, W, STROKE_WIDTH }, |
| 78 { 0, 0, STROKE_WIDTH/2, STROKE_WIDTH/2 }, | 78 { 0, 0, STROKE_WIDTH/2, STROKE_WIDTH/2 }, |
| 79 { 0, 0, W, 0 }, | 79 { 0, 0, W, 0 }, |
| 80 { 0, 0, 0, H }, | 80 { 0, 0, 0, H }, |
| 81 { 0, 0, 0, 0 }, | 81 { 0, 0, 0, 0 }, |
| 82 { 0, 0, W, FLT_EPSILON }, |
| 83 { 0, 0, FLT_EPSILON, H }, |
| 84 { 0, 0, FLT_EPSILON, FLT_EPSILON }, |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 for (int doFill = 0; doFill <= 1; ++doFill) { | 87 for (int doFill = 0; doFill <= 1; ++doFill) { |
| 85 for (size_t i = 0; i < SK_ARRAY_COUNT(gJoins); ++i) { | 88 for (size_t i = 0; i < SK_ARRAY_COUNT(gJoins); ++i) { |
| 86 SkPaint::Join join = gJoins[i]; | 89 SkPaint::Join join = gJoins[i]; |
| 87 paint.setStrokeJoin(join); | 90 paint.setStrokeJoin(join); |
| 88 | 91 |
| 89 SkAutoCanvasRestore acr(canvas, true); | 92 SkAutoCanvasRestore acr(canvas, true); |
| 90 for (size_t j = 0; j < SK_ARRAY_COUNT(gRects); ++j) { | 93 for (size_t j = 0; j < SK_ARRAY_COUNT(gRects); ++j) { |
| 91 const SkRect& r = gRects[j]; | 94 const SkRect& r = gRects[j]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 104 } | 107 } |
| 105 } | 108 } |
| 106 | 109 |
| 107 private: | 110 private: |
| 108 typedef GM INHERITED; | 111 typedef GM INHERITED; |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 114 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 112 | 115 |
| 113 DEF_GM(return new StrokeRectGM;) | 116 DEF_GM(return new StrokeRectGM;) |
| OLD | NEW |