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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 SkIRect limit = { 0, 0, kMaxClipCoord, kMaxClipCoord }; | 679 SkIRect limit = { 0, 0, kMaxClipCoord, kMaxClipCoord }; |
680 tmpClipStorage.op(origClip, limit, SkRegion::kIntersect_Op); | 680 tmpClipStorage.op(origClip, limit, SkRegion::kIntersect_Op); |
681 clipRgn = &tmpClipStorage; | 681 clipRgn = &tmpClipStorage; |
682 } | 682 } |
683 } | 683 } |
684 // for here down, use clipRgn, not origClip | 684 // for here down, use clipRgn, not origClip |
685 | 685 |
686 SkScanClipper clipper(blitter, clipRgn, ir); | 686 SkScanClipper clipper(blitter, clipRgn, ir); |
687 const SkIRect* clipRect = clipper.getClipRect(); | 687 const SkIRect* clipRect = clipper.getClipRect(); |
688 | 688 |
689 if (clipper.getBlitter() == NULL) { // clipped out | 689 if (clipper.getBlitter() == nullptr) { // clipped out |
690 if (isInverse) { | 690 if (isInverse) { |
691 blitter->blitRegion(*clipRgn); | 691 blitter->blitRegion(*clipRgn); |
692 } | 692 } |
693 return; | 693 return; |
694 } | 694 } |
695 | 695 |
696 // now use the (possibly wrapped) blitter | 696 // now use the (possibly wrapped) blitter |
697 blitter = clipper.getBlitter(); | 697 blitter = clipper.getBlitter(); |
698 | 698 |
699 if (isInverse) { | 699 if (isInverse) { |
700 sk_blit_above(blitter, ir, *clipRgn); | 700 sk_blit_above(blitter, ir, *clipRgn); |
701 } | 701 } |
702 | 702 |
703 SkIRect superRect, *superClipRect = NULL; | 703 SkIRect superRect, *superClipRect = nullptr; |
704 | 704 |
705 if (clipRect) { | 705 if (clipRect) { |
706 superRect.set( clipRect->fLeft << SHIFT, clipRect->fTop << SHIFT, | 706 superRect.set( clipRect->fLeft << SHIFT, clipRect->fTop << SHIFT, |
707 clipRect->fRight << SHIFT, clipRect->fBottom << SHIFT); | 707 clipRect->fRight << SHIFT, clipRect->fBottom << SHIFT); |
708 superClipRect = &superRect; | 708 superClipRect = &superRect; |
709 } | 709 } |
710 | 710 |
711 SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop); | 711 SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop); |
712 | 712 |
713 // MaskSuperBlitter can't handle drawing outside of ir, so we can't use it | 713 // MaskSuperBlitter can't handle drawing outside of ir, so we can't use it |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 AntiFillPath(path, clip.bwRgn(), blitter); | 758 AntiFillPath(path, clip.bwRgn(), blitter); |
759 } else { | 759 } else { |
760 SkRegion tmp; | 760 SkRegion tmp; |
761 SkAAClipBlitter aaBlitter; | 761 SkAAClipBlitter aaBlitter; |
762 | 762 |
763 tmp.setRect(clip.getBounds()); | 763 tmp.setRect(clip.getBounds()); |
764 aaBlitter.init(blitter, &clip.aaRgn()); | 764 aaBlitter.init(blitter, &clip.aaRgn()); |
765 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); | 765 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); |
766 } | 766 } |
767 } | 767 } |
OLD | NEW |