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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 } | 558 } |
559 | 559 |
560 static inline void blit_two_alphas(AdditiveBlitter* blitter, int y, int x, | 560 static inline void blit_two_alphas(AdditiveBlitter* blitter, int y, int x, |
561 SkAlpha a1, SkAlpha a2, SkAlpha fullAlpha, SkAlpha*
maskRow, | 561 SkAlpha a1, SkAlpha a2, SkAlpha fullAlpha, SkAlpha*
maskRow, |
562 bool isUsingMask) { | 562 bool isUsingMask) { |
563 if (isUsingMask) { | 563 if (isUsingMask) { |
564 addAlpha(maskRow[x], a1); | 564 addAlpha(maskRow[x], a1); |
565 addAlpha(maskRow[x + 1], a2); | 565 addAlpha(maskRow[x + 1], a2); |
566 } else { | 566 } else { |
567 if (fullAlpha == 0xFF) { | 567 if (fullAlpha == 0xFF) { |
568 blitter->getRealBlitter()->blitV(x, y, 1, a1); | 568 blitter->getRealBlitter()->blitAntiH2(x, y, a1, a2); |
569 blitter->getRealBlitter()->blitV(x + 1, y, 1, a2); | |
570 } else { | 569 } else { |
571 blitter->blitAntiH(x, y, a1); | 570 blitter->blitAntiH(x, y, a1); |
572 blitter->blitAntiH(x + 1, y, a2); | 571 blitter->blitAntiH(x + 1, y, a2); |
573 } | 572 } |
574 } | 573 } |
575 } | 574 } |
576 | 575 |
577 // It's important that this is inline. Otherwise it'll be much slower. | 576 // It's important that this is inline. Otherwise it'll be much slower. |
578 static SK_ALWAYS_INLINE void blit_full_alpha(AdditiveBlitter* blitter, int y, in
t x, int len, | 577 static SK_ALWAYS_INLINE void blit_full_alpha(AdditiveBlitter* blitter, int y, in
t x, int len, |
579 SkAlpha fullAlpha, SkAlpha* maskRow, bool isUsingMas
k) { | 578 SkAlpha fullAlpha, SkAlpha* maskRow, bool isUsingMas
k) { |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 AAAFillPath(path, clip.bwRgn(), blitter); | 1269 AAAFillPath(path, clip.bwRgn(), blitter); |
1271 } else { | 1270 } else { |
1272 SkRegion tmp; | 1271 SkRegion tmp; |
1273 SkAAClipBlitter aaBlitter; | 1272 SkAAClipBlitter aaBlitter; |
1274 | 1273 |
1275 tmp.setRect(clip.getBounds()); | 1274 tmp.setRect(clip.getBounds()); |
1276 aaBlitter.init(blitter, &clip.aaRgn()); | 1275 aaBlitter.init(blitter, &clip.aaRgn()); |
1277 AAAFillPath(path, tmp, &aaBlitter); | 1276 AAAFillPath(path, tmp, &aaBlitter); |
1278 } | 1277 } |
1279 } | 1278 } |
OLD | NEW |