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

Side by Side Diff: src/core/SkClipStack.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/animator/SkSnapshot.cpp ('k') | src/core/SkDraw.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 "SkClipStack.h" 8 #include "SkClipStack.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkThread.h" 10 #include "SkThread.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 } 282 }
283 283
284 if (!fDoAA) { 284 if (!fDoAA) {
285 // Here we mimic a non-anti-aliased scanline system. If there is 285 // Here we mimic a non-anti-aliased scanline system. If there is
286 // no anti-aliasing we can integerize the bounding box to exclude 286 // no anti-aliasing we can integerize the bounding box to exclude
287 // fractional parts that won't be rendered. 287 // fractional parts that won't be rendered.
288 // Note: the left edge is handled slightly differently below. We 288 // Note: the left edge is handled slightly differently below. We
289 // are a bit more generous in the rounding since we don't want to 289 // are a bit more generous in the rounding since we don't want to
290 // risk missing the left pixels when fLeft is very close to .5 290 // risk missing the left pixels when fLeft is very close to .5
291 fFiniteBound.set(SkIntToScalar(SkScalarFloorToInt(fFiniteBound.fLeft+0.4 5f)), 291 fFiniteBound.set(SkScalarFloorToScalar(fFiniteBound.fLeft+0.45f),
292 SkIntToScalar(SkScalarRound(fFiniteBound.fTop)), 292 SkScalarRoundToScalar(fFiniteBound.fTop),
293 SkIntToScalar(SkScalarRound(fFiniteBound.fRight)), 293 SkScalarRoundToScalar(fFiniteBound.fRight),
294 SkIntToScalar(SkScalarRound(fFiniteBound.fBottom))); 294 SkScalarRoundToScalar(fFiniteBound.fBottom));
295 } 295 }
296 296
297 // Now determine the previous Element's bound information taking into 297 // Now determine the previous Element's bound information taking into
298 // account that there may be no previous clip 298 // account that there may be no previous clip
299 SkRect prevFinite; 299 SkRect prevFinite;
300 SkClipStack::BoundsType prevType; 300 SkClipStack::BoundsType prevType;
301 301
302 if (NULL == prior) { 302 if (NULL == prior) {
303 // no prior clip means the entire plane is writable 303 // no prior clip means the entire plane is writable
304 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to 304 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 return kWideOpenGenID; 727 return kWideOpenGenID;
728 } 728 }
729 729
730 const Element* back = static_cast<const Element*>(fDeque.back()); 730 const Element* back = static_cast<const Element*>(fDeque.back());
731 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is Empty()) { 731 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is Empty()) {
732 return kWideOpenGenID; 732 return kWideOpenGenID;
733 } 733 }
734 734
735 return back->getGenID(); 735 return back->getGenID();
736 } 736 }
OLDNEW
« no previous file with comments | « src/animator/SkSnapshot.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698