| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkView.h" | 9 #include "SkView.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 canvas->save(); | 67 canvas->save(); |
| 68 circle(canvas, width, false); | 68 circle(canvas, width, false); |
| 69 canvas->translate(0, dy); | 69 canvas->translate(0, dy); |
| 70 circle(canvas, width, true); | 70 circle(canvas, width, true); |
| 71 canvas->restore(); | 71 canvas->restore(); |
| 72 canvas->translate(dx, 0); | 72 canvas->translate(dx, 0); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 static void blowup(SkCanvas* canvas, const SkIRect& src, const SkRect& dst)
{ | 76 static void blowup(SkCanvas* canvas, const SkIRect& src, const SkRect& dst)
{ |
| 77 SkDevice* device = canvas->getDevice(); | 77 SkBaseDevice* device = canvas->getDevice(); |
| 78 const SkBitmap& bm = device->accessBitmap(false); | 78 const SkBitmap& bm = device->accessBitmap(false); |
| 79 canvas->drawBitmapRect(bm, &src, dst, NULL); | 79 canvas->drawBitmapRect(bm, &src, dst, NULL); |
| 80 } | 80 } |
| 81 | 81 |
| 82 static void make_poly(SkPath* path, int n) { | 82 static void make_poly(SkPath* path, int n) { |
| 83 if (n <= 0) { | 83 if (n <= 0) { |
| 84 return; | 84 return; |
| 85 } | 85 } |
| 86 path->incReserve(n + 1); | 86 path->incReserve(n + 1); |
| 87 path->moveTo(SK_Scalar1, 0); | 87 path->moveTo(SK_Scalar1, 0); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 const SkScalar CircleView::ANIM_DX(SK_Scalar1 / 67); | 128 const SkScalar CircleView::ANIM_DX(SK_Scalar1 / 67); |
| 129 const SkScalar CircleView::ANIM_DY(SK_Scalar1 / 29); | 129 const SkScalar CircleView::ANIM_DY(SK_Scalar1 / 29); |
| 130 const SkScalar CircleView::ANIM_RAD(SK_Scalar1 / 19); | 130 const SkScalar CircleView::ANIM_RAD(SK_Scalar1 / 19); |
| 131 | 131 |
| 132 ////////////////////////////////////////////////////////////////////////////// | 132 ////////////////////////////////////////////////////////////////////////////// |
| 133 | 133 |
| 134 static SkView* MyFactory() { return new CircleView; } | 134 static SkView* MyFactory() { return new CircleView; } |
| 135 static SkViewRegister reg(MyFactory); | 135 static SkViewRegister reg(MyFactory); |
| OLD | NEW |