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

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

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add cast to work around win compiler Created 5 years 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 | « src/core/SkScan_Antihair.cpp ('k') | src/core/SkUtils.cpp » ('j') | 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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkScanPriv.h" 8 #include "SkScanPriv.h"
9 #include "SkBlitter.h" 9 #include "SkBlitter.h"
10 #include "SkEdge.h" 10 #include "SkEdge.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 headEdge.fX = SK_MinS32; 443 headEdge.fX = SK_MinS32;
444 edge->fPrev = &headEdge; 444 edge->fPrev = &headEdge;
445 445
446 tailEdge.fPrev = last; 446 tailEdge.fPrev = last;
447 tailEdge.fNext = nullptr; 447 tailEdge.fNext = nullptr;
448 tailEdge.fFirstY = kEDGE_TAIL_Y; 448 tailEdge.fFirstY = kEDGE_TAIL_Y;
449 last->fNext = &tailEdge; 449 last->fNext = &tailEdge;
450 450
451 // now edge is the head of the sorted linklist 451 // now edge is the head of the sorted linklist
452 452
453 start_y <<= shiftEdgesUp; 453 start_y = SkLeftShift(start_y, shiftEdgesUp);
454 stop_y <<= shiftEdgesUp; 454 stop_y = SkLeftShift(stop_y, shiftEdgesUp);
455 if (clipRect && start_y < clipRect->fTop) { 455 if (clipRect && start_y < clipRect->fTop) {
456 start_y = clipRect->fTop; 456 start_y = clipRect->fTop;
457 } 457 }
458 if (clipRect && stop_y > clipRect->fBottom) { 458 if (clipRect && stop_y > clipRect->fBottom) {
459 stop_y = clipRect->fBottom; 459 stop_y = clipRect->fBottom;
460 } 460 }
461 461
462 InverseBlitter ib; 462 InverseBlitter ib;
463 PrePostProc proc = nullptr; 463 PrePostProc proc = nullptr;
464 464
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 clipRgn = &wrap.getRgn(); 700 clipRgn = &wrap.getRgn();
701 blitter = wrap.getBlitter(); 701 blitter = wrap.getBlitter();
702 } 702 }
703 703
704 SkScanClipper clipper(blitter, clipRgn, ir); 704 SkScanClipper clipper(blitter, clipRgn, ir);
705 blitter = clipper.getBlitter(); 705 blitter = clipper.getBlitter();
706 if (blitter) { 706 if (blitter) {
707 sk_fill_triangle(pts, clipper.getClipRect(), blitter, ir); 707 sk_fill_triangle(pts, clipper.getClipRect(), blitter, ir);
708 } 708 }
709 } 709 }
OLDNEW
« no previous file with comments | « src/core/SkScan_Antihair.cpp ('k') | src/core/SkUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698