| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 typedef void (*raster_proc)(SkLayerRasterizer*, SkPaint&); | 147 typedef void (*raster_proc)(SkLayerRasterizer*, SkPaint&); |
| 148 | 148 |
| 149 #include "SkXfermode.h" | 149 #include "SkXfermode.h" |
| 150 | 150 |
| 151 static void apply_shader(SkPaint* paint, float scale) | 151 static void apply_shader(SkPaint* paint, float scale) |
| 152 { | 152 { |
| 153 SkPaint p; | 153 SkPaint p; |
| 154 SkLayerRasterizer* rast = new SkLayerRasterizer; | 154 SkLayerRasterizer* rast = new SkLayerRasterizer; |
| 155 | 155 |
| 156 p.setAntiAlias(true); | 156 p.setAntiAlias(true); |
| 157 r7(rast, p, SkFloatToScalar(scale)); | 157 r7(rast, p, scale); |
| 158 paint->setRasterizer(rast)->unref(); | 158 paint->setRasterizer(rast)->unref(); |
| 159 | 159 |
| 160 paint->setColor(SK_ColorBLUE); | 160 paint->setColor(SK_ColorBLUE); |
| 161 } | 161 } |
| 162 | 162 |
| 163 class ClockFaceView : public SkView { | 163 class ClockFaceView : public SkView { |
| 164 SkTypeface* fFace; | 164 SkTypeface* fFace; |
| 165 SkScalar fInterp; | 165 SkScalar fInterp; |
| 166 SkScalar fDx; | 166 SkScalar fDx; |
| 167 | 167 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 private: | 245 private: |
| 246 typedef SkView INHERITED; | 246 typedef SkView INHERITED; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 ////////////////////////////////////////////////////////////////////////////// | 249 ////////////////////////////////////////////////////////////////////////////// |
| 250 | 250 |
| 251 static SkView* MyFactory() { return new ClockFaceView; } | 251 static SkView* MyFactory() { return new ClockFaceView; } |
| 252 static SkViewRegister reg(MyFactory); | 252 static SkViewRegister reg(MyFactory); |
| OLD | NEW |