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 | |
429 // Now determine the previous Element's bound information taking into | 422 // Now determine the previous Element's bound information taking into |
430 // account that there may be no previous clip | 423 // account that there may be no previous clip |
431 SkRect prevFinite; | 424 SkRect prevFinite; |
432 SkClipStack::BoundsType prevType; | 425 SkClipStack::BoundsType prevType; |
433 | 426 |
434 if (NULL == prior) { | 427 if (NULL == prior) { |
435 // no prior clip means the entire plane is writable | 428 // no prior clip means the entire plane is writable |
436 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to | 429 prevFinite.setEmpty(); // there are no pixels that cannot be drawn to |
437 prevType = kInsideOut_BoundsType; | 430 prevType = kInsideOut_BoundsType; |
438 } else { | 431 } else { |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 | 899 |
907 void SkClipStack::dump() const { | 900 void SkClipStack::dump() const { |
908 B2TIter iter(*this); | 901 B2TIter iter(*this); |
909 const Element* e; | 902 const Element* e; |
910 while ((e = iter.next())) { | 903 while ((e = iter.next())) { |
911 e->dump(); | 904 e->dump(); |
912 SkDebugf("\n"); | 905 SkDebugf("\n"); |
913 } | 906 } |
914 } | 907 } |
915 #endif | 908 #endif |
OLD | NEW |