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

Side by Side Diff: src/core/SkRTree.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/core/SkDraw.cpp ('k') | src/core/SkRegion_path.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 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 #include "SkRTree.h" 8 #include "SkRTree.h"
9 #include "SkTSort.h" 9 #include "SkTSort.h"
10 10
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 ++numBranches; 338 ++numBranches;
339 // If the remainder isn't enough to fill a node, we'll need to add f ewer nodes to 339 // If the remainder isn't enough to fill a node, we'll need to add f ewer nodes to
340 // some other branches to make up for it 340 // some other branches to make up for it
341 if (remainder >= fMinChildren) { 341 if (remainder >= fMinChildren) {
342 remainder = 0; 342 remainder = 0;
343 } else { 343 } else {
344 remainder = fMinChildren - remainder; 344 remainder = fMinChildren - remainder;
345 } 345 }
346 } 346 }
347 347
348 int numStrips = SkScalarCeil(SkScalarSqrt(SkIntToScalar(numBranches) * 348 int numStrips = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(numBranches ) *
349 SkScalarInvert(fAspectRatio))); 349 SkScalarInvert(fAspectRatio)));
350 int numTiles = SkScalarCeil(SkIntToScalar(numBranches) / 350 int numTiles = SkScalarCeilToInt(SkIntToScalar(numBranches) /
351 SkIntToScalar(numStrips)); 351 SkIntToScalar(numStrips));
352 int currentBranch = 0; 352 int currentBranch = 0;
353 353
354 for (int i = 0; i < numStrips; ++i) { 354 for (int i = 0; i < numStrips; ++i) {
355 // Once again, if we are told to do so, we sort by x. 355 // Once again, if we are told to do so, we sort by x.
356 if (fSortWhenBulkLoading) { 356 if (fSortWhenBulkLoading) {
357 int begin = currentBranch; 357 int begin = currentBranch;
358 int end = currentBranch + numTiles * fMaxChildren - SkMin32(rema inder, 358 int end = currentBranch + numTiles * fMaxChildren - SkMin32(rema inder,
359 (fMaxChildren - fMinChildren) * numTiles); 359 (fMaxChildren - fMinChildren) * numTiles);
360 if (end > branches->count()) { 360 if (end > branches->count()) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 473
474 // Expand 'out' to include 'joinWith' 474 // Expand 'out' to include 'joinWith'
475 static inline void join_no_empty_check(const SkIRect& joinWith, SkIRect* out) { 475 static inline void join_no_empty_check(const SkIRect& joinWith, SkIRect* out) {
476 // since we check for empty bounds on insert, we know we'll never have empty rects 476 // since we check for empty bounds on insert, we know we'll never have empty rects
477 // and we can save the empty check that SkIRect::join requires 477 // and we can save the empty check that SkIRect::join requires
478 if (joinWith.fLeft < out->fLeft) { out->fLeft = joinWith.fLeft; } 478 if (joinWith.fLeft < out->fLeft) { out->fLeft = joinWith.fLeft; }
479 if (joinWith.fTop < out->fTop) { out->fTop = joinWith.fTop; } 479 if (joinWith.fTop < out->fTop) { out->fTop = joinWith.fTop; }
480 if (joinWith.fRight > out->fRight) { out->fRight = joinWith.fRight; } 480 if (joinWith.fRight > out->fRight) { out->fRight = joinWith.fRight; }
481 if (joinWith.fBottom > out->fBottom) { out->fBottom = joinWith.fBottom; } 481 if (joinWith.fBottom > out->fBottom) { out->fBottom = joinWith.fBottom; }
482 } 482 }
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkRegion_path.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698