OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The Android Open Source Project | 2 * Copyright 2016 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 "SkAntiRun.h" | 8 #include "SkAntiRun.h" |
9 #include "SkBlitter.h" | 9 #include "SkBlitter.h" |
10 #include "SkEdge.h" | 10 #include "SkEdge.h" |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 const SkFixed kSnapHalf = kSnapDigit >> 1; | 1041 const SkFixed kSnapHalf = kSnapDigit >> 1; |
1042 const SkFixed kSnapMask = (-1 ^ (kSnapDigit - 1)); | 1042 const SkFixed kSnapMask = (-1 ^ (kSnapDigit - 1)); |
1043 left += kSnapHalf; rite += kSnapHalf; // For fast rounding | 1043 left += kSnapHalf; rite += kSnapHalf; // For fast rounding |
1044 | 1044 |
1045 // Number of blit_trapezoid_row calls we'll have | 1045 // Number of blit_trapezoid_row calls we'll have |
1046 int count = SkFixedCeilToInt(local_bot_fixed) - SkFixedFloorToInt(y)
; | 1046 int count = SkFixedCeilToInt(local_bot_fixed) - SkFixedFloorToInt(y)
; |
1047 #ifdef SK_DEBUG | 1047 #ifdef SK_DEBUG |
1048 total_y_cnt += count; | 1048 total_y_cnt += count; |
1049 frac_y_cnt += ((int)(y & 0xFFFF0000) != y); | 1049 frac_y_cnt += ((int)(y & 0xFFFF0000) != y); |
1050 if ((int)(y & 0xFFFF0000) != y) { | 1050 if ((int)(y & 0xFFFF0000) != y) { |
1051 SkDebugf("frac_y = %f\n", SkFixedToFloat(y)); | 1051 // SkDebugf("frac_y = %f\n", SkFixedToFloat(y)); |
1052 } | 1052 } |
1053 #endif | 1053 #endif |
1054 | 1054 |
1055 // If we're using mask blitter, we advance the mask row in this func
tion | 1055 // If we're using mask blitter, we advance the mask row in this func
tion |
1056 // to save some "if" condition checks. | 1056 // to save some "if" condition checks. |
1057 SkAlpha* maskRow = nullptr; | 1057 SkAlpha* maskRow = nullptr; |
1058 if (isUsingMask) { | 1058 if (isUsingMask) { |
1059 maskRow = static_cast<MaskAdditiveBlitter*>(blitter)->getRow(y >
> 16); | 1059 maskRow = static_cast<MaskAdditiveBlitter*>(blitter)->getRow(y >
> 16); |
1060 } | 1060 } |
1061 | 1061 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 } | 1117 } |
1118 | 1118 |
1119 leftE->fX = left; | 1119 leftE->fX = left; |
1120 riteE->fX = rite; | 1120 riteE->fX = rite; |
1121 leftE->fY = riteE->fY = y; | 1121 leftE->fY = riteE->fY = y; |
1122 } | 1122 } |
1123 | 1123 |
1124 END_WALK: | 1124 END_WALK: |
1125 ; | 1125 ; |
1126 #ifdef SK_DEBUG | 1126 #ifdef SK_DEBUG |
1127 SkDebugf("frac_y_cnt = %d, total_y_cnt = %d\n", frac_y_cnt, total_y_cnt); | 1127 // SkDebugf("frac_y_cnt = %d, total_y_cnt = %d\n", frac_y_cnt, total_y_cnt); |
1128 #endif | 1128 #endif |
1129 } | 1129 } |
1130 | 1130 |
1131 void SkScan::aaa_fill_path(const SkPath& path, const SkIRect* clipRect, Additive
Blitter* blitter, | 1131 void SkScan::aaa_fill_path(const SkPath& path, const SkIRect* clipRect, Additive
Blitter* blitter, |
1132 int start_y, int stop_y, const SkRegion& clipRgn, bool isUsin
gMask, | 1132 int start_y, int stop_y, const SkRegion& clipRgn, bool isUsin
gMask, |
1133 bool forceRLE) { // forceRLE implies that SkAAClip is calling
us | 1133 bool forceRLE) { // forceRLE implies that SkAAClip is calling
us |
1134 SkASSERT(blitter); | 1134 SkASSERT(blitter); |
1135 | 1135 |
1136 // we only implemented the convex shapes yet | 1136 // we only implemented the convex shapes yet |
1137 SkASSERT(!path.isInverseFillType() && path.isConvex()); | 1137 SkASSERT(!path.isInverseFillType() && path.isConvex()); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 AAAFillPath(path, clip.bwRgn(), blitter); | 1341 AAAFillPath(path, clip.bwRgn(), blitter); |
1342 } else { | 1342 } else { |
1343 SkRegion tmp; | 1343 SkRegion tmp; |
1344 SkAAClipBlitter aaBlitter; | 1344 SkAAClipBlitter aaBlitter; |
1345 | 1345 |
1346 tmp.setRect(clip.getBounds()); | 1346 tmp.setRect(clip.getBounds()); |
1347 aaBlitter.init(blitter, &clip.aaRgn()); | 1347 aaBlitter.init(blitter, &clip.aaRgn()); |
1348 AAAFillPath(path, tmp, &aaBlitter, true); | 1348 AAAFillPath(path, tmp, &aaBlitter, true); |
1349 } | 1349 } |
1350 } | 1350 } |
OLD | NEW |