1096 {
1098
1102
1103 SkFixed y = std::max(leftE->fUpperY, riteE->fUpperY);
1104
1105 for (;;) {
1106
1107
1108 while (leftE->fLowerY <=
y) {
1109 if (!leftE->update(
y)) {
1111 goto END_WALK;
1112 }
1113 leftE = currE;
1115 }
1116 }
1117 while (riteE->fLowerY <=
y) {
1118 if (!riteE->update(
y)) {
1120 goto END_WALK;
1121 }
1122 riteE = currE;
1124 }
1125 }
1126
1129
1130
1132 break;
1133 }
1134
1137
1140
1141 if (leftE->fX > riteE->fX || (leftE->fX == riteE->fX && leftE->fDX > riteE->fDX)) {
1142 std::swap(leftE, riteE);
1143 }
1144
1145 SkFixed local_bot_fixed = std::min(leftE->fLowerY, riteE->fLowerY);
1148 }
1149 local_bot_fixed = std::min(local_bot_fixed,
SkIntToFixed(stop_y));
1150
1153 SkFixed rite = std::min(riteBound, riteE->fX);
1155 if (0 == (dLeft | dRite)) {
1164 if (fullTop > fullBot) {
1166 partialBot = 0;
1167 }
1168
1169 if (fullRite >= fullLeft) {
1170 if (partialTop > 0) {
1171 if (partialLeft > 0) {
1173 fullTop - 1,
1175 }
1177 fullLeft, fullTop - 1, fullRite - fullLeft,
fixed_to_alpha(partialTop));
1178 if (partialRite > 0) {
1180 fullTop - 1,
1182 }
1184 }
1185
1186
1187 if (fullBot > fullTop &&
1188
1189
1193 fullTop,
1194 fullRite - fullLeft,
1195 fullBot - fullTop,
1198 }
1199
1200 if (partialBot > 0) {
1201 if (partialLeft > 0) {
1203 fullBot,
1205 }
1207 fullLeft, fullBot, fullRite - fullLeft,
fixed_to_alpha(partialBot));
1208 if (partialRite > 0) {
1210 fullBot,
1212 }
1213 }
1214 } else {
1215
1216
1217
1218
1221 if (partialTop > 0) {
1223 fullTop - 1,
1224 1,
1227 }
1228 if (fullBot > fullTop) {
1231 }
1232 if (partialBot > 0) {
1234 fullBot,
1235 1,
1237 }
1238 }
1239 }
1240
1241 y = local_bot_fixed;
1242 } else {
1243
1244
1245
1247 const SkFixed kSnapHalf = kSnapDigit >> 1;
1248 const SkFixed kSnapMask = (-1 ^ (kSnapDigit - 1));
1250 rite += kSnapHalf;
1251
1252
1254
1255
1256
1258 if (isUsingMask) {
1260 }
1261
1262
1263
1264
1265
1267 if ((
int)(
y & 0xFFFF0000) !=
y) {
1273 SkASSERT((
left & kSnapMask) >= leftBound && (rite & kSnapMask) <= riteBound &&
1274 (nextLeft & kSnapMask) >= leftBound &&
1275 (nextRite & kSnapMask) <= riteBound);
1279 rite & kSnapMask,
1280 nextLeft & kSnapMask,
1281 nextRite & kSnapMask,
1282 leftE->fDY,
1283 riteE->fDY,
1285 maskRow,
1286 isUsingMask);
1289 rite = nextRite;
1291 }
1292
1295 if (isUsingMask) {
1297 }
1299 SkASSERT((
left & kSnapMask) >= leftBound && (rite & kSnapMask) <= riteBound &&
1300 (nextLeft & kSnapMask) >= leftBound &&
1301 (nextRite & kSnapMask) <= riteBound);
1305 rite & kSnapMask,
1306 nextLeft & kSnapMask,
1307 nextRite & kSnapMask,
1308 leftE->fDY,
1309 riteE->fDY,
1310 0xFF,
1311 maskRow,
1312 isUsingMask);
1315 rite = nextRite;
1317 }
1318 }
1319
1320 if (isUsingMask) {
1322 }
1323
1326
1327
1328
1330 SkFixed nextRite = std::min(rite +
SkFixedMul(dRite, dY), riteBound + kSnapHalf);
1331 SkASSERT((
left & kSnapMask) >= leftBound && (rite & kSnapMask) <= riteBound &&
1332 (nextLeft & kSnapMask) >= leftBound && (nextRite & kSnapMask) <= riteBound);
1336 rite & kSnapMask,
1337 nextLeft & kSnapMask,
1338 nextRite & kSnapMask,
1339 leftE->fDY,
1340 riteE->fDY,
1342 maskRow,
1343 isUsingMask);
1346 rite = nextRite;
1347 y = local_bot_fixed;
1349 rite -= kSnapHalf;
1350 }
1351
1353 riteE->fX = rite;
1354 leftE->fY = riteE->fY =
y;
1355 }
1356
1357END_WALK:;
1358}
#define SkFixedCeilToInt(x)
static SkFixed SkFixedCeilToFixed(SkFixed x)
static SkFixed SkFixedMul(SkFixed a, SkFixed b)
static bool left(const SkPoint &p0, const SkPoint &p1)
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 isUsingMask, bool noRealBlitter=false, bool needSafeCheck=false)
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)
#define validate_sort(edge)
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.