1048 {
1050
1054
1056
1057 for (;;) {
1058
1059
1063 goto END_WALK;
1064 }
1065 leftE = currE;
1067 }
1068 }
1069 while (riteE->fLowerY <=
y) {
1070 if (!riteE->update(
y)) {
1072 goto END_WALK;
1073 }
1074 riteE = currE;
1076 }
1077 }
1078
1081
1082
1084 break;
1085 }
1086
1089
1092
1093 if (leftE->
fX > riteE->fX || (leftE->
fX == riteE->fX && leftE->
fDX > riteE->fDX)) {
1095 }
1096
1100 }
1102
1107 if (0 == (dLeft | dRite)) {
1116 if (fullTop > fullBot) {
1118 partialBot = 0;
1119 }
1120
1121 if (fullRite >= fullLeft) {
1122 if (partialTop > 0) {
1123 if (partialLeft > 0) {
1125 fullTop - 1,
1127 }
1129 fullLeft, fullTop - 1, fullRite - fullLeft,
fixed_to_alpha(partialTop));
1130 if (partialRite > 0) {
1132 fullTop - 1,
1134 }
1136 }
1137
1138
1139 if (fullBot > fullTop &&
1140
1141
1145 fullTop,
1146 fullRite - fullLeft,
1147 fullBot - fullTop,
1150 }
1151
1152 if (partialBot > 0) {
1153 if (partialLeft > 0) {
1155 fullBot,
1157 }
1159 fullLeft, fullBot, fullRite - fullLeft,
fixed_to_alpha(partialBot));
1160 if (partialRite > 0) {
1162 fullBot,
1164 }
1165 }
1166 } else {
1167
1168
1169
1170
1173 if (partialTop > 0) {
1175 fullTop - 1,
1176 1,
1179 }
1180 if (fullBot > fullTop) {
1183 }
1184 if (partialBot > 0) {
1186 fullBot,
1187 1,
1189 }
1190 }
1191 }
1192
1193 y = local_bot_fixed;
1194 } else {
1195
1196
1197
1199 const SkFixed kSnapHalf = kSnapDigit >> 1;
1200 const SkFixed kSnapMask = (-1 ^ (kSnapDigit - 1));
1202 rite += kSnapHalf;
1203
1204
1206
1207
1208
1209 SkAlpha* maskRow = isUsingMask
1211 : nullptr;
1212
1213
1214
1215
1216
1218 if ((
int)(
y & 0xFFFF0000) !=
y) {
1224 SkASSERT((
left & kSnapMask) >= leftBound && (rite & kSnapMask) <= riteBound &&
1225 (nextLeft & kSnapMask) >= leftBound &&
1226 (nextRite & kSnapMask) <= riteBound);
1230 rite & kSnapMask,
1231 nextLeft & kSnapMask,
1232 nextRite & kSnapMask,
1234 riteE->fDY,
1236 maskRow,
1237 false);
1240 rite = nextRite;
1242 }
1243
1246 if (isUsingMask) {
1248 }
1250 SkASSERT((
left & kSnapMask) >= leftBound && (rite & kSnapMask) <= riteBound &&
1251 (nextLeft & kSnapMask) >= leftBound &&
1252 (nextRite & kSnapMask) <= riteBound);
1256 rite & kSnapMask,
1257 nextLeft & kSnapMask,
1258 nextRite & kSnapMask,
1260 riteE->fDY,
1261 0xFF,
1262 maskRow,
1263 false);
1266 rite = nextRite;
1268 }
1269 }
1270
1271 if (isUsingMask) {
1273 }
1274
1277
1278
1279
1282 SkASSERT((
left & kSnapMask) >= leftBound && (rite & kSnapMask) <= riteBound &&
1283 (nextLeft & kSnapMask) >= leftBound && (nextRite & kSnapMask) <= riteBound);
1287 rite & kSnapMask,
1288 nextLeft & kSnapMask,
1289 nextRite & kSnapMask,
1291 riteE->fDY,
1293 maskRow,
1294 false);
1297 rite = nextRite;
1298 y = local_bot_fixed;
1300 rite -= kSnapHalf;
1301 }
1302
1304 riteE->fX = rite;
1305 leftE->
fY = riteE->fY =
y;
1306 }
1307
1308END_WALK:;
1309}
#define SkFixedCeilToInt(x)
static SkFixed SkFixedCeilToFixed(SkFixed x)
#define SkFixedFloorToInt(x)
static SkFixed SkFixedMul(SkFixed a, SkFixed b)
static bool left(const SkPoint &p0, const SkPoint &p1)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static void validate_sort(const SkAnalyticEdge *edge)
static SkAlpha fixed_to_alpha(SkFixed f)
static bool is_smooth_enough(SkAnalyticEdge *thisEdge, SkAnalyticEdge *nextEdge, int stop_y)
static SkAlpha get_partial_alpha(SkAlpha alpha, SkFixed partialHeight)
static void blit_trapezoid_row(AdditiveBlitter *blitter, int y, SkFixed ul, SkFixed ur, SkFixed ll, SkFixed lr, SkFixed lDY, SkFixed rDY, SkAlpha fullAlpha, SkAlpha *maskRow, bool noRealBlitter)
virtual void flush_if_y_changed(SkFixed y, SkFixed nextY)=0
virtual void blitAntiH(int x, int y, const SkAlpha antialias[], int len)=0
virtual void blitAntiRect(int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha)
virtual void blitV(int x, int y, int height, SkAlpha alpha)
Blit a vertical run of pixels with a constant alpha value.
bool update(SkFixed last_y, bool sortY=true)