Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: samplecode/ClockFaceView.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkScalar.h ('k') | samplecode/SampleAARects.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« no previous file with comments | « include/core/SkScalar.h ('k') | samplecode/SampleAARects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698