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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 #include "SkXfermode.h" | 157 #include "SkXfermode.h" |
158 | 158 |
159 static void apply_shader(SkPaint* paint, float scale) | 159 static void apply_shader(SkPaint* paint, float scale) |
160 { | 160 { |
161 SkPaint p; | 161 SkPaint p; |
162 SkLayerRasterizer::Builder rastBuilder; | 162 SkLayerRasterizer::Builder rastBuilder; |
163 | 163 |
164 p.setAntiAlias(true); | 164 p.setAntiAlias(true); |
165 r7(&rastBuilder, p, scale); | 165 r7(&rastBuilder, p, scale); |
166 paint->setRasterizer(rastBuilder.detachRasterizer())->unref(); | 166 paint->setRasterizer(rastBuilder.detach()); |
167 | 167 |
168 paint->setColor(SK_ColorBLUE); | 168 paint->setColor(SK_ColorBLUE); |
169 } | 169 } |
170 | 170 |
171 class ClockFaceView : public SkView { | 171 class ClockFaceView : public SkView { |
172 SkTypeface* fFace; | 172 SkTypeface* fFace; |
173 SkScalar fInterp; | 173 SkScalar fInterp; |
174 SkScalar fDx; | 174 SkScalar fDx; |
175 | 175 |
176 public: | 176 public: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 250 } |
251 | 251 |
252 private: | 252 private: |
253 typedef SkView INHERITED; | 253 typedef SkView INHERITED; |
254 }; | 254 }; |
255 | 255 |
256 ////////////////////////////////////////////////////////////////////////////// | 256 ////////////////////////////////////////////////////////////////////////////// |
257 | 257 |
258 static SkView* MyFactory() { return new ClockFaceView; } | 258 static SkView* MyFactory() { return new ClockFaceView; } |
259 static SkViewRegister reg(MyFactory); | 259 static SkViewRegister reg(MyFactory); |
OLD | NEW |