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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 canvas->drawOval(ovalRect, paint); | 52 canvas->drawOval(ovalRect, paint); |
53 canvas->restore(); // for saveLayer | 53 canvas->restore(); // for saveLayer |
54 canvas->restore(); | 54 canvas->restore(); |
55 } | 55 } |
56 | 56 |
57 virtual SkISize onISize() { | 57 virtual SkISize onISize() { |
58 return SkISize::Make(520, 100); | 58 return SkISize::Make(520, 100); |
59 } | 59 } |
60 | 60 |
61 virtual void onDraw(SkCanvas* canvas) { | 61 virtual void onDraw(SkCanvas* canvas) { |
62 canvas->clear(0x00000000); | 62 canvas->clear(SK_ColorBLACK); |
63 | 63 |
64 SkRect srcRect = SkRect::MakeWH(96, 96); | 64 SkRect srcRect = SkRect::MakeWH(96, 96); |
65 | 65 |
66 SkSize deviceSize = SkSize::Make(16, 16); | 66 SkSize deviceSize = SkSize::Make(16, 16); |
67 draw(canvas, | 67 draw(canvas, |
68 srcRect, | 68 srcRect, |
69 deviceSize, | 69 deviceSize, |
70 kNone_SkFilterQuality); | 70 kNone_SkFilterQuality); |
71 | 71 |
72 canvas->translate(srcRect.width() + SkIntToScalar(10), 0); | 72 canvas->translate(srcRect.width() + SkIntToScalar(10), 0); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 private: | 113 private: |
114 typedef GM INHERITED; | 114 typedef GM INHERITED; |
115 }; | 115 }; |
116 | 116 |
117 ////////////////////////////////////////////////////////////////////////////// | 117 ////////////////////////////////////////////////////////////////////////////// |
118 | 118 |
119 static GM* MyFactory(void*) { return new ResizeGM; } | 119 static GM* MyFactory(void*) { return new ResizeGM; } |
120 static GMRegistry reg(MyFactory); | 120 static GMRegistry reg(MyFactory); |
121 | 121 |
122 } | 122 } |
OLD | NEW |