| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 public: | 45 public: |
| 46 StrokeRectGM() {} | 46 StrokeRectGM() {} |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 | 49 |
| 50 SkString onShortName() override { | 50 SkString onShortName() override { |
| 51 return SkString("strokerect"); | 51 return SkString("strokerect"); |
| 52 } | 52 } |
| 53 | 53 |
| 54 SkISize onISize() override { | 54 SkISize onISize() override { |
| 55 return SkISize::Make(1024, 740); | 55 return SkISize::Make(1400, 740); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void onDraw(SkCanvas* canvas) override { | 58 void onDraw(SkCanvas* canvas) override { |
| 59 canvas->drawColor(SK_ColorWHITE); | 59 canvas->drawColor(SK_ColorWHITE); |
| 60 canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2); | 60 canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2); |
| 61 | 61 |
| 62 SkPaint paint; | 62 SkPaint paint; |
| 63 paint.setStyle(SkPaint::kStroke_Style); | 63 paint.setStyle(SkPaint::kStroke_Style); |
| 64 paint.setStrokeWidth(STROKE_WIDTH); | 64 paint.setStrokeWidth(STROKE_WIDTH); |
| 65 | 65 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 */ | 120 */ |
| 121 DEF_SIMPLE_GM(strokerect_anisotropic_5408, canvas, 200, 50) { | 121 DEF_SIMPLE_GM(strokerect_anisotropic_5408, canvas, 200, 50) { |
| 122 SkPaint p; | 122 SkPaint p; |
| 123 p.setStyle(SkPaint::kStroke_Style); | 123 p.setStyle(SkPaint::kStroke_Style); |
| 124 p.setStrokeWidth(6); | 124 p.setStrokeWidth(6); |
| 125 | 125 |
| 126 canvas->scale(10, 1); | 126 canvas->scale(10, 1); |
| 127 SkRect r = SkRect::MakeXYWH(5, 20, 10, 10); | 127 SkRect r = SkRect::MakeXYWH(5, 20, 10, 10); |
| 128 canvas->drawRect(r, p); | 128 canvas->drawRect(r, p); |
| 129 } | 129 } |
| OLD | NEW |