Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: src/core/SkScan_AntiPath.cpp

Issue 1661873003: use left-shift macro to fix/avoid undefined behvarior warnings (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = nullptr; 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(SkLeftShift(clipRect->fLeft, SHIFT),
707 clipRect->fRight << SHIFT, clipRect->fBottom << SHIFT); 707 SkLeftShift(clipRect->fTop, SHIFT),
708 SkLeftShift(clipRect->fRight, SHIFT),
709 SkLeftShift(clipRect->fBottom, SHIFT));
708 superClipRect = &superRect; 710 superClipRect = &superRect;
709 } 711 }
710 712
711 SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop); 713 SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop);
712 714
713 // MaskSuperBlitter can't handle drawing outside of ir, so we can't use it 715 // MaskSuperBlitter can't handle drawing outside of ir, so we can't use it
714 // if we're an inverse filltype 716 // if we're an inverse filltype
715 if (!isInverse && MaskSuperBlitter::CanHandleRect(ir) && !forceRLE) { 717 if (!isInverse && MaskSuperBlitter::CanHandleRect(ir) && !forceRLE) {
716 MaskSuperBlitter superBlit(blitter, ir, *clipRgn, isInverse); 718 MaskSuperBlitter superBlit(blitter, ir, *clipRgn, isInverse);
717 SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop); 719 SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 AntiFillPath(path, clip.bwRgn(), blitter); 760 AntiFillPath(path, clip.bwRgn(), blitter);
759 } else { 761 } else {
760 SkRegion tmp; 762 SkRegion tmp;
761 SkAAClipBlitter aaBlitter; 763 SkAAClipBlitter aaBlitter;
762 764
763 tmp.setRect(clip.getBounds()); 765 tmp.setRect(clip.getBounds());
764 aaBlitter.init(blitter, &clip.aaRgn()); 766 aaBlitter.init(blitter, &clip.aaRgn());
765 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); 767 SkScan::AntiFillPath(path, tmp, &aaBlitter, true);
766 } 768 }
767 } 769 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698