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

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

Issue 1424253002: SkScan_Antihair: assert in debug and potentialy lost last pixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: test Created 5 years, 1 month 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 | tests/RectTest.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 /* 2 /*
3 * Copyright 2011 The Android Open Source Project 3 * Copyright 2011 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 "SkScan.h" 10 #include "SkScan.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 // need precise rounding (not just SkAlphaMul) so that values like 840 // need precise rounding (not just SkAlphaMul) so that values like
841 // a=228, b=252 don't overflow the result 841 // a=228, b=252 don't overflow the result
842 return SkToU8(a + b - SkAlphaMulRound(a, b)); 842 return SkToU8(a + b - SkAlphaMulRound(a, b));
843 } 843 }
844 844
845 static void inner_scanline(FDot8 L, int top, FDot8 R, U8CPU alpha, 845 static void inner_scanline(FDot8 L, int top, FDot8 R, U8CPU alpha,
846 SkBlitter* blitter) { 846 SkBlitter* blitter) {
847 SkASSERT(L < R); 847 SkASSERT(L < R);
848 848
849 if ((L >> 8) == ((R - 1) >> 8)) { // 1x1 pixel 849 if ((L >> 8) == ((R - 1) >> 8)) { // 1x1 pixel
850 blitter->blitV(L >> 8, top, 1, InvAlphaMul(alpha, R - L)); 850 FDot8 widClamp = R - L;
851 // border case clamp 256 to 255 instead of going through call_hline_blit ter
852 // see skbug/4406
853 widClamp = widClamp - (widClamp >> 8);
854 blitter->blitV(L >> 8, top, 1, InvAlphaMul(alpha, widClamp));
851 return; 855 return;
852 } 856 }
853 857
854 int left = L >> 8; 858 int left = L >> 8;
855 if (L & 0xFF) { 859 if (L & 0xFF) {
856 blitter->blitV(left, top, 1, InvAlphaMul(alpha, L & 0xFF)); 860 blitter->blitV(left, top, 1, InvAlphaMul(alpha, L & 0xFF));
857 left += 1; 861 left += 1;
858 } 862 }
859 863
860 int rite = R >> 8; 864 int rite = R >> 8;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 998
995 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize, 999 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize,
996 const SkRasterClip& clip, SkBlitter* blitter) { 1000 const SkRasterClip& clip, SkBlitter* blitter) {
997 if (clip.isBW()) { 1001 if (clip.isBW()) {
998 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter); 1002 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter);
999 } else { 1003 } else {
1000 SkAAClipBlitterWrapper wrap(clip, blitter); 1004 SkAAClipBlitterWrapper wrap(clip, blitter);
1001 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter()); 1005 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter());
1002 } 1006 }
1003 } 1007 }
OLDNEW
« no previous file with comments | « no previous file | tests/RectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698