OLD | NEW |
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 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkClipStack.h" | 9 #include "SkClipStack.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 fFiniteBoundType = kInsideOut_BoundsType; | 412 fFiniteBoundType = kInsideOut_BoundsType; |
413 } else { | 413 } else { |
414 fFiniteBoundType = kNormal_BoundsType; | 414 fFiniteBoundType = kNormal_BoundsType; |
415 } | 415 } |
416 break; | 416 break; |
417 case kEmpty_Type: | 417 case kEmpty_Type: |
418 SkDEBUGFAIL("We shouldn't get here with an empty element."); | 418 SkDEBUGFAIL("We shouldn't get here with an empty element."); |
419 break; | 419 break; |
420 } | 420 } |
421 | 421 |
| 422 if (!fDoAA) { |
| 423 fFiniteBound.set(SkScalarFloorToScalar(fFiniteBound.fLeft+0.45f), |
| 424 SkScalarRoundToScalar(fFiniteBound.fTop), |
| 425 SkScalarRoundToScalar(fFiniteBound.fRight), |
| 426 SkScalarRoundToScalar(fFiniteBound.fBottom)); |
| 427 } |
| 428 |
422 // Now determine the previous Element's bound information taking into | 429 // Now determine the previous Element's bound information taking into |
423 // account that there may be no previous clip | 430 // account that there may be no previous clip |
424 SkRect prevFinite; | 431 SkRect prevFinite; |
425 SkClipStack::BoundsType prevType; | 432 SkClipStack::BoundsType prevType; |
426 | 433 |
427 if (NULL == prior) { | 434 if (NULL == prior) { |
428 // no prior clip means the entire plane is writable | 435 // no prior clip means the entire plane is writable |
429 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to | 436 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to |
430 prevType = kInsideOut_BoundsType; | 437 prevType = kInsideOut_BoundsType; |
431 } else { | 438 } else { |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 | 906 |
900 void SkClipStack::dump() const { | 907 void SkClipStack::dump() const { |
901 B2TIter iter(*this); | 908 B2TIter iter(*this); |
902 const Element* e; | 909 const Element* e; |
903 while ((e = iter.next())) { | 910 while ((e = iter.next())) { |
904 e->dump(); | 911 e->dump(); |
905 SkDebugf("\n"); | 912 SkDebugf("\n"); |
906 } | 913 } |
907 } | 914 } |
908 #endif | 915 #endif |
OLD | NEW |