OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 | 9 |
10 #include "SkScanPriv.h" | 10 #include "SkScanPriv.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 { | 447 { |
448 SkASSERT(CanHandleRect(ir)); | 448 SkASSERT(CanHandleRect(ir)); |
449 SkASSERT(!isInverse); | 449 SkASSERT(!isInverse); |
450 | 450 |
451 fMask.fImage = (uint8_t*)fStorage; | 451 fMask.fImage = (uint8_t*)fStorage; |
452 fMask.fBounds = ir; | 452 fMask.fBounds = ir; |
453 fMask.fRowBytes = ir.width(); | 453 fMask.fRowBytes = ir.width(); |
454 fMask.fFormat = SkMask::kA8_Format; | 454 fMask.fFormat = SkMask::kA8_Format; |
455 | 455 |
456 fClipRect = ir; | 456 fClipRect = ir; |
457 if (!fClipRect.intersect(clip.getBounds())) { | 457 fClipRect.intersect(clip.getBounds()); |
458 SkASSERT(0); | |
459 fClipRect.setEmpty(); | |
460 } | |
461 | 458 |
462 // For valgrind, write 1 extra byte at the end so we don't read | 459 // For valgrind, write 1 extra byte at the end so we don't read |
463 // uninitialized memory. See comment in add_aa_span and fStorage[]. | 460 // uninitialized memory. See comment in add_aa_span and fStorage[]. |
464 memset(fStorage, 0, fMask.fBounds.height() * fMask.fRowBytes + 1); | 461 memset(fStorage, 0, fMask.fBounds.height() * fMask.fRowBytes + 1); |
465 } | 462 } |
466 | 463 |
467 static void add_aa_span(uint8_t* alpha, U8CPU startAlpha) { | 464 static void add_aa_span(uint8_t* alpha, U8CPU startAlpha) { |
468 /* I should be able to just add alpha[x] + startAlpha. | 465 /* I should be able to just add alpha[x] + startAlpha. |
469 However, if the trailing edge of the previous span and the leading | 466 However, if the trailing edge of the previous span and the leading |
470 edge of the current span round to the same super-sampled x value, | 467 edge of the current span round to the same super-sampled x value, |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 AntiFillPath(path, clip.bwRgn(), blitter); | 763 AntiFillPath(path, clip.bwRgn(), blitter); |
767 } else { | 764 } else { |
768 SkRegion tmp; | 765 SkRegion tmp; |
769 SkAAClipBlitter aaBlitter; | 766 SkAAClipBlitter aaBlitter; |
770 | 767 |
771 tmp.setRect(clip.getBounds()); | 768 tmp.setRect(clip.getBounds()); |
772 aaBlitter.init(blitter, &clip.aaRgn()); | 769 aaBlitter.init(blitter, &clip.aaRgn()); |
773 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); | 770 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); |
774 } | 771 } |
775 } | 772 } |
OLD | NEW |