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

Side by Side Diff: samplecode/TransitionView.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/SampleTextOnPath.cpp ('k') | samplecode/vertexdump.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #include "TransitionView.h" 7 #include "TransitionView.h"
8 8
9 #include "OverView.h" 9 #include "OverView.h"
10 #include "SampleCode.h" 10 #include "SampleCode.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 fBegin[kNextX] = lr; 151 fBegin[kNextX] = lr;
152 fBegin[kNextY] = ud; 152 fBegin[kNextY] = ud;
153 fNext->setLocX(lr); 153 fNext->setLocX(lr);
154 fNext->setLocY(ud); 154 fNext->setLocY(ud);
155 155
156 if (is_transition(fPrev)) 156 if (is_transition(fPrev))
157 lr = ud = 0; 157 lr = ud = 0;
158 fEnd[kPrevX] = -lr; 158 fEnd[kPrevX] = -lr;
159 fEnd[kPrevY] = -ud; 159 fEnd[kPrevY] = -ud;
160 fEnd[kNextX] = fEnd[kNextY] = 0; 160 fEnd[kNextX] = fEnd[kNextY] = 0;
161 SkScalar blend[] = { SkFloatToScalar(0.8f), SkFloatToScalar(0.0f), 161 SkScalar blend[] = { 0.8f, 0.0f,
162 SkFloatToScalar(0.0f), SK_Scalar1 }; 162 0.0f, SK_Scalar1 };
163 fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend); 163 fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend);
164 fInterp.setKeyFrame(1, SkTime::GetMSecs()+kDurationMS, fEnd, blend); 164 fInterp.setKeyFrame(1, SkTime::GetMSecs()+kDurationMS, fEnd, blend);
165 } 165 }
166 166
167 private: 167 private:
168 enum { 168 enum {
169 kPrevX = 0, 169 kPrevX = 0,
170 kPrevY = 1, 170 kPrevY = 1,
171 kNextX = 2, 171 kNextX = 2,
172 kNextY = 3 172 kNextY = 3
(...skipping 22 matching lines...) Expand all
195 }; 195 };
196 196
197 SkView* create_transition(SkView* prev, SkView* next, int direction) { 197 SkView* create_transition(SkView* prev, SkView* next, int direction) {
198 #ifdef SK_BUILD_FOR_ANDROID 198 #ifdef SK_BUILD_FOR_ANDROID
199 // Disable transitions for Android 199 // Disable transitions for Android
200 return next; 200 return next;
201 #else 201 #else
202 return SkNEW_ARGS(TransitionView, (prev, next, direction)); 202 return SkNEW_ARGS(TransitionView, (prev, next, direction));
203 #endif 203 #endif
204 } 204 }
OLDNEW
« no previous file with comments | « samplecode/SampleTextOnPath.cpp ('k') | samplecode/vertexdump.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698