| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
| 10 #include "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 SkPaint paint; | 53 SkPaint paint; |
| 54 paint.setColor(0xFF00FF00); | 54 paint.setColor(0xFF00FF00); |
| 55 SkRect ovalRect = rect; | 55 SkRect ovalRect = rect; |
| 56 ovalRect.inset(SkIntToScalar(4), SkIntToScalar(4)); | 56 ovalRect.inset(SkIntToScalar(4), SkIntToScalar(4)); |
| 57 canvas->drawOval(ovalRect, paint); | 57 canvas->drawOval(ovalRect, paint); |
| 58 canvas->restore(); // for saveLayer | 58 canvas->restore(); // for saveLayer |
| 59 canvas->restore(); | 59 canvas->restore(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual SkISize onISize() { | 62 virtual SkISize onISize() { |
| 63 return make_isize(520, 100); | 63 return SkISize::Make(520, 100); |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual void onDraw(SkCanvas* canvas) { | 66 virtual void onDraw(SkCanvas* canvas) { |
| 67 canvas->clear(0x00000000); | 67 canvas->clear(0x00000000); |
| 68 | 68 |
| 69 SkRect srcRect = SkRect::MakeWH(96, 96); | 69 SkRect srcRect = SkRect::MakeWH(96, 96); |
| 70 | 70 |
| 71 SkSize deviceSize = SkSize::Make(16, 16); | 71 SkSize deviceSize = SkSize::Make(16, 16); |
| 72 draw(canvas, | 72 draw(canvas, |
| 73 srcRect, | 73 srcRect, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 private: | 118 private: |
| 119 typedef GM INHERITED; | 119 typedef GM INHERITED; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 ////////////////////////////////////////////////////////////////////////////// | 122 ////////////////////////////////////////////////////////////////////////////// |
| 123 | 123 |
| 124 static GM* MyFactory(void*) { return new ResizeGM; } | 124 static GM* MyFactory(void*) { return new ResizeGM; } |
| 125 static GMRegistry reg(MyFactory); | 125 static GMRegistry reg(MyFactory); |
| 126 | 126 |
| 127 } | 127 } |
| OLD | NEW |