| 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 29 matching lines...) Expand all Loading... |
| 40 * | 40 * |
| 41 * geometry: normal, small (smaller than stroke-width), empty, inverted | 41 * geometry: normal, small (smaller than stroke-width), empty, inverted |
| 42 * joint-type for the corners | 42 * joint-type for the corners |
| 43 */ | 43 */ |
| 44 class StrokeRectGM : public skiagm::GM { | 44 class StrokeRectGM : public skiagm::GM { |
| 45 public: | 45 public: |
| 46 StrokeRectGM() {} | 46 StrokeRectGM() {} |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 | 49 |
| 50 SkString onShortName() SK_OVERRIDE { | 50 SkString onShortName() override { |
| 51 return SkString("strokerect"); | 51 return SkString("strokerect"); |
| 52 } | 52 } |
| 53 | 53 |
| 54 SkISize onISize() SK_OVERRIDE { | 54 SkISize onISize() override { |
| 55 return SkISize::Make(1024, 740); | 55 return SkISize::Make(1024, 740); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void onDraw(SkCanvas* canvas) SK_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 |
| 66 static const SkPaint::Join gJoins[] = { | 66 static const SkPaint::Join gJoins[] = { |
| 67 SkPaint::kMiter_Join, SkPaint::kRound_Join, SkPaint::kBevel_Join | 67 SkPaint::kMiter_Join, SkPaint::kRound_Join, SkPaint::kBevel_Join |
| 68 }; | 68 }; |
| (...skipping 35 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 |