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

Side by Side Diff: gm/simpleaaclip.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 | « gm/shaderbounds.cpp ('k') | gyp/common.gypi » ('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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 8
9 #include "gm.h" 9 #include "gm.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 enum SkGeomTypes { 46 enum SkGeomTypes {
47 kRect_GeomType, 47 kRect_GeomType,
48 kPath_GeomType, 48 kPath_GeomType,
49 kAAClip_GeomType 49 kAAClip_GeomType
50 }; 50 };
51 51
52 SimpleClipGM(SkGeomTypes geomType) 52 SimpleClipGM(SkGeomTypes geomType)
53 : fGeomType(geomType) { 53 : fGeomType(geomType) {
54 54
55 // offset the rects a bit so we get anti-aliasing in the rect case 55 // offset the rects a bit so we get anti-aliasing in the rect case
56 fBase.set(SkFloatToScalar(100.65f), 56 fBase.set(100.65f,
57 SkFloatToScalar(100.65f), 57 100.65f,
58 SkFloatToScalar(150.65f), 58 150.65f,
59 SkFloatToScalar(150.65f)); 59 150.65f);
60 fRect = fBase; 60 fRect = fBase;
61 fRect.inset(5, 5); 61 fRect.inset(5, 5);
62 fRect.offset(25, 25); 62 fRect.offset(25, 25);
63 63
64 fBasePath.addRoundRect(fBase, SkIntToScalar(5), SkIntToScalar(5)); 64 fBasePath.addRoundRect(fBase, SkIntToScalar(5), SkIntToScalar(5));
65 fRectPath.addRoundRect(fRect, SkIntToScalar(5), SkIntToScalar(5)); 65 fRectPath.addRoundRect(fRect, SkIntToScalar(5), SkIntToScalar(5));
66 INHERITED::setBGColor(0xFFDDDDDD); 66 INHERITED::setBGColor(0xFFDDDDDD);
67 } 67 }
68 68
69 protected: 69 protected:
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 }; 193 };
194 194
195 ////////////////////////////////////////////////////////////////////////////// 195 //////////////////////////////////////////////////////////////////////////////
196 196
197 // rects 197 // rects
198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) 198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); )
199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) 199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); )
200 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) 200 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); )
201 201
202 } 202 }
OLDNEW
« no previous file with comments | « gm/shaderbounds.cpp ('k') | gyp/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698