| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkDrawable.h" | 10 #include "SkDrawable.h" |
| 11 #include "SkPath.h" |
| 11 | 12 |
| 12 struct MyDrawable : public SkDrawable { | 13 struct MyDrawable : public SkDrawable { |
| 13 SkRect onGetBounds() override { return SkRect::MakeWH(50, 100); } | 14 SkRect onGetBounds() override { return SkRect::MakeWH(50, 100); } |
| 14 | 15 |
| 15 void onDraw(SkCanvas* canvas) override { | 16 void onDraw(SkCanvas* canvas) override { |
| 16 SkPath path; | 17 SkPath path; |
| 17 path.moveTo(10, 10); | 18 path.moveTo(10, 10); |
| 18 path.conicTo(10, 90, 50, 90, 0.9f); | 19 path.conicTo(10, 90, 50, 90, 0.9f); |
| 19 | 20 |
| 20 SkPaint paint; | 21 SkPaint paint; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 canvas->drawDrawable(drawable); | 38 canvas->drawDrawable(drawable); |
| 38 canvas->drawDrawable(drawable, 0, 150); | 39 canvas->drawDrawable(drawable, 0, 150); |
| 39 | 40 |
| 40 SkMatrix m = SkMatrix::MakeScale(1.5f, 0.8f); | 41 SkMatrix m = SkMatrix::MakeScale(1.5f, 0.8f); |
| 41 m.postTranslate(70, 0); | 42 m.postTranslate(70, 0); |
| 42 canvas->drawDrawable(drawable, &m); | 43 canvas->drawDrawable(drawable, &m); |
| 43 | 44 |
| 44 m.postTranslate(0, 150); | 45 m.postTranslate(0, 150); |
| 45 canvas->drawDrawable(drawable, &m); | 46 canvas->drawDrawable(drawable, &m); |
| 46 } | 47 } |
| OLD | NEW |