OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
| 7 |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkCanvas.h" |
9 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
10 #include "SkGradientShader.h" | 11 #include "SkGradientShader.h" |
| 12 #include "SkPath.h" |
| 13 #include "SkUtils.h" |
11 #include "SkView.h" | 14 #include "SkView.h" |
12 #include "SkCanvas.h" | |
13 #include "SkUtils.h" | |
14 | 15 |
15 static void draw_rect(SkCanvas* canvas, const SkRect& r, const SkPaint& p) { | 16 static void draw_rect(SkCanvas* canvas, const SkRect& r, const SkPaint& p) { |
16 canvas->drawRect(r, p); | 17 canvas->drawRect(r, p); |
17 | 18 |
18 SkPaint frame(p); | 19 SkPaint frame(p); |
19 frame.setShader(NULL); | 20 frame.setShader(NULL); |
20 frame.setStyle(SkPaint::kStroke_Style); | 21 frame.setStyle(SkPaint::kStroke_Style); |
21 canvas->drawRect(r, frame); | 22 canvas->drawRect(r, frame); |
22 } | 23 } |
23 | 24 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 | 143 |
143 private: | 144 private: |
144 typedef SampleView INHERITED; | 145 typedef SampleView INHERITED; |
145 }; | 146 }; |
146 | 147 |
147 ////////////////////////////////////////////////////////////////////////////// | 148 ////////////////////////////////////////////////////////////////////////////// |
148 | 149 |
149 static SkView* MyFactory() { return new DitherBitmapView; } | 150 static SkView* MyFactory() { return new DitherBitmapView; } |
150 static SkViewRegister reg(MyFactory); | 151 static SkViewRegister reg(MyFactory); |
OLD | NEW |