| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |