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

Side by Side Diff: samplecode/SampleSlides.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 | « samplecode/SampleRegion.cpp ('k') | samplecode/SampleText.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 path->transform(m); 73 path->transform(m);
74 } 74 }
75 75
76 static void one_d_pe(SkPaint* paint) { 76 static void one_d_pe(SkPaint* paint) {
77 SkPath path; 77 SkPath path;
78 path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1])); 78 path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1]));
79 for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2) 79 for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2)
80 path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1])); 80 path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1]));
81 path.close(); 81 path.close();
82 path.offset(SkIntToScalar(-6), 0); 82 path.offset(SkIntToScalar(-6), 0);
83 scale(&path, SkFloatToScalar(1.5f)); 83 scale(&path, 1.5f);
84 84
85 paint->setPathEffect(new SkPath1DPathEffect(path, SkIntToScalar(21), 0, 85 paint->setPathEffect(new SkPath1DPathEffect(path, SkIntToScalar(21), 0,
86 SkPath1DPathEffect::kRotate_Style))->unref(); 86 SkPath1DPathEffect::kRotate_Style))->unref();
87 compose_pe(paint); 87 compose_pe(paint);
88 } 88 }
89 89
90 typedef void (*PE_Proc)(SkPaint*); 90 typedef void (*PE_Proc)(SkPaint*);
91 static const PE_Proc gPE[] = { hair_pe, hair2_pe, stroke_pe, dash_pe, one_d_pe } ; 91 static const PE_Proc gPE[] = { hair_pe, hair2_pe, stroke_pe, dash_pe, one_d_pe } ;
92 92
93 static void fill_pe(SkPaint* paint) { 93 static void fill_pe(SkPaint* paint) {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 725 }
726 726
727 private: 727 private:
728 typedef SampleView INHERITED; 728 typedef SampleView INHERITED;
729 }; 729 };
730 730
731 ////////////////////////////////////////////////////////////////////////////// 731 //////////////////////////////////////////////////////////////////////////////
732 732
733 static SkView* MyFactory() { return new SlideView; } 733 static SkView* MyFactory() { return new SlideView; }
734 static SkViewRegister reg(MyFactory); 734 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleRegion.cpp ('k') | samplecode/SampleText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698