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

Side by Side Diff: samplecode/SampleDegenerateTwoPtRadials.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/SampleCull.cpp ('k') | samplecode/SampleFilter2.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if (SampleCode::TitleQ(*evt)) { 51 if (SampleCode::TitleQ(*evt)) {
52 SampleCode::TitleR(evt, "DegenerateTwoPtRadials"); 52 SampleCode::TitleR(evt, "DegenerateTwoPtRadials");
53 return true; 53 return true;
54 } 54 }
55 return this->INHERITED::onQuery(evt); 55 return this->INHERITED::onQuery(evt);
56 } 56 }
57 57
58 virtual void onDrawContent(SkCanvas* canvas) { 58 virtual void onDrawContent(SkCanvas* canvas) {
59 fTime += SampleCode::GetAnimSecondsDelta(); 59 fTime += SampleCode::GetAnimSecondsDelta();
60 SkScalar delta = fTime / 15.f; 60 SkScalar delta = fTime / 15.f;
61 int intPart = SkScalarFloor(delta); 61 int intPart = SkScalarFloorToInt(delta);
62 delta = delta - SK_Scalar1 * intPart; 62 delta = delta - SK_Scalar1 * intPart;
63 if (intPart % 2) { 63 if (intPart % 2) {
64 delta = SK_Scalar1 - delta; 64 delta = SK_Scalar1 - delta;
65 } 65 }
66 delta -= SK_ScalarHalf; 66 delta -= SK_ScalarHalf;
67 static const int DELTA_SCALE = 500; 67 static const int DELTA_SCALE = 500;
68 delta /= DELTA_SCALE; 68 delta /= DELTA_SCALE;
69 69
70 SkScalar w = SK_Scalar1 * 500; 70 SkScalar w = SK_Scalar1 * 500;
71 SkScalar h = SK_Scalar1 * 500; 71 SkScalar h = SK_Scalar1 * 500;
(...skipping 11 matching lines...) Expand all
83 83
84 private: 84 private:
85 SkScalar fTime; 85 SkScalar fTime;
86 typedef SampleView INHERITED; 86 typedef SampleView INHERITED;
87 }; 87 };
88 88
89 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
90 90
91 static SkView* MyFactory() { return new DegenerateTwoPtRadialsView; } 91 static SkView* MyFactory() { return new DegenerateTwoPtRadialsView; }
92 static SkViewRegister reg(MyFactory); 92 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleCull.cpp ('k') | samplecode/SampleFilter2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698