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

Side by Side Diff: src/views/SkStackViewLayout.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 | « src/views/SkParsePaint.cpp ('k') | src/views/SkWindow.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 "SkStackViewLayout.h" 8 #include "SkStackViewLayout.h"
9 9
10 SkStackViewLayout::SkStackViewLayout() 10 SkStackViewLayout::SkStackViewLayout()
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 SkScalar flexAmount = 0; 160 SkScalar flexAmount = 0;
161 SkView::B2FIter iter(parent); 161 SkView::B2FIter iter(parent);
162 SkView* child; 162 SkView* child;
163 163
164 if (flexCount > 0 && parentLimit > childLimit) 164 if (flexCount > 0 && parentLimit > childLimit)
165 flexAmount = (parentLimit - childLimit) / flexCount; 165 flexAmount = (parentLimit - childLimit) / flexCount;
166 166
167 while ((child = iter.next()) != NULL) 167 while ((child = iter.next()) != NULL)
168 { 168 {
169 if (fRound) 169 if (fRound)
170 pos = SkIntToScalar(SkScalarRound(pos)); 170 pos = SkScalarRoundToScalar(pos);
171 (child->*mainLocP)(pos); 171 (child->*mainLocP)(pos);
172 SkScalar crossLoc = crossStartM + gAlignProcs[fAlign]((child->*crossGetS izeP)(), crossLimit); 172 SkScalar crossLoc = crossStartM + gAlignProcs[fAlign]((child->*crossGetS izeP)(), crossLimit);
173 if (fRound) 173 if (fRound)
174 crossLoc = SkIntToScalar(SkScalarRound(crossLoc)); 174 crossLoc = SkScalarRoundToScalar(crossLoc);
175 (child->*crossLocP)(crossLoc); 175 (child->*crossLocP)(crossLoc);
176 176
177 if (crossSetSizeP) 177 if (crossSetSizeP)
178 (child->*crossSetSizeP)(crossLimit); 178 (child->*crossSetSizeP)(crossLimit);
179 if (child->getFlags() & flexMask) 179 if (child->getFlags() & flexMask)
180 (child->*mainSetSizeP)(flexAmount); 180 (child->*mainSetSizeP)(flexAmount);
181 pos += (child->*mainGetSizeP)() + fSpacer; 181 pos += (child->*mainGetSizeP)() + fSpacer;
182 } 182 }
183 } 183 }
184 184
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 child->setSize( parent->width() - fMargin.fRight - fMargin.fLeft, 264 child->setSize( parent->width() - fMargin.fRight - fMargin.fLeft,
265 parent->height() - fMargin.fBottom - fMargin.fTop); 265 parent->height() - fMargin.fBottom - fMargin.fTop);
266 } 266 }
267 } 267 }
268 268
269 void SkFillViewLayout::onInflate(const SkDOM& dom, const SkDOM::Node* node) 269 void SkFillViewLayout::onInflate(const SkDOM& dom, const SkDOM::Node* node)
270 { 270 {
271 this->INHERITED::onInflate(dom, node); 271 this->INHERITED::onInflate(dom, node);
272 (void)dom.findScalars(node, "margin", (SkScalar*)&fMargin, 4); 272 (void)dom.findScalars(node, "margin", (SkScalar*)&fMargin, 4);
273 } 273 }
OLDNEW
« no previous file with comments | « src/views/SkParsePaint.cpp ('k') | src/views/SkWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698