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

Side by Side Diff: src/opts/SkXfermode_opts_arm_neon.cpp

Issue 23724013: ARM Skia NEON patches - 29 - Xfermode: SkFourByteInterp (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Review comments Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/opts/SkColor_opts_neon.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "SkXfermode.h" 1 #include "SkXfermode.h"
2 #include "SkXfermode_proccoeff.h" 2 #include "SkXfermode_proccoeff.h"
3 #include "SkColorPriv.h" 3 #include "SkColorPriv.h"
4 4
5 #include <arm_neon.h> 5 #include <arm_neon.h>
6 #include "SkColor_opts_neon.h" 6 #include "SkColor_opts_neon.h"
7 #include "SkXfermode_opts_arm_neon.h" 7 #include "SkXfermode_opts_arm_neon.h"
8 8
9 #define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b) 9 #define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b)
10 10
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 for (int i = 0; i < count; i++) { 625 for (int i = 0; i < count; i++) {
626 dst[i] = proc(src[i], dst[i]); 626 dst[i] = proc(src[i], dst[i]);
627 } 627 }
628 } else { 628 } else {
629 for (int i = count - 1; i >= 0; --i) { 629 for (int i = count - 1; i >= 0; --i) {
630 unsigned a = aa[i]; 630 unsigned a = aa[i];
631 if (0 != a) { 631 if (0 != a) {
632 SkPMColor dstC = dst[i]; 632 SkPMColor dstC = dst[i];
633 SkPMColor C = proc(src[i], dstC); 633 SkPMColor C = proc(src[i], dstC);
634 if (a != 0xFF) { 634 if (a != 0xFF) {
635 C = SkFourByteInterp(C, dstC, a); 635 C = SkFourByteInterp_neon(C, dstC, a);
636 } 636 }
637 dst[i] = C; 637 dst[i] = C;
638 } 638 }
639 } 639 }
640 } 640 }
641 } 641 }
642 642
643 void SkNEONProcCoeffXfermode::xfer16(uint16_t* SK_RESTRICT dst, 643 void SkNEONProcCoeffXfermode::xfer16(uint16_t* SK_RESTRICT dst,
644 const SkPMColor* SK_RESTRICT src, int count , 644 const SkPMColor* SK_RESTRICT src, int count ,
645 const SkAlpha* SK_RESTRICT aa) const { 645 const SkAlpha* SK_RESTRICT aa) const {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 SkPMColor dstC = SkPixel16ToPixel32(dst[i]); 693 SkPMColor dstC = SkPixel16ToPixel32(dst[i]);
694 dst[i] = SkPixel32ToPixel16_ToU16(proc(src[i], dstC)); 694 dst[i] = SkPixel32ToPixel16_ToU16(proc(src[i], dstC));
695 } 695 }
696 } else { 696 } else {
697 for (int i = count - 1; i >= 0; --i) { 697 for (int i = count - 1; i >= 0; --i) {
698 unsigned a = aa[i]; 698 unsigned a = aa[i];
699 if (0 != a) { 699 if (0 != a) {
700 SkPMColor dstC = SkPixel16ToPixel32(dst[i]); 700 SkPMColor dstC = SkPixel16ToPixel32(dst[i]);
701 SkPMColor C = proc(src[i], dstC); 701 SkPMColor C = proc(src[i], dstC);
702 if (0xFF != a) { 702 if (0xFF != a) {
703 C = SkFourByteInterp(C, dstC, a); 703 C = SkFourByteInterp_neon(C, dstC, a);
704 } 704 }
705 dst[i] = SkPixel32ToPixel16_ToU16(C); 705 dst[i] = SkPixel32ToPixel16_ToU16(C);
706 } 706 }
707 } 707 }
708 } 708 }
709 } 709 }
710 710
711 #ifdef SK_DEVELOPER 711 #ifdef SK_DEVELOPER
712 void SkNEONProcCoeffXfermode::toString(SkString* str) const { 712 void SkNEONProcCoeffXfermode::toString(SkString* str) const {
713 this->INHERITED::toString(str); 713 this->INHERITED::toString(str);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 SkProcCoeffXfermode* SkPlatformXfermodeFactory_impl_neon(const ProcCoeff& rec, 758 SkProcCoeffXfermode* SkPlatformXfermodeFactory_impl_neon(const ProcCoeff& rec,
759 SkXfermode::Mode mode) { 759 SkXfermode::Mode mode) {
760 760
761 void* procSIMD = reinterpret_cast<void*>(gNEONXfermodeProcs[mode]); 761 void* procSIMD = reinterpret_cast<void*>(gNEONXfermodeProcs[mode]);
762 762
763 if (procSIMD != NULL) { 763 if (procSIMD != NULL) {
764 return SkNEW_ARGS(SkNEONProcCoeffXfermode, (rec, mode, procSIMD)); 764 return SkNEW_ARGS(SkNEONProcCoeffXfermode, (rec, mode, procSIMD));
765 } 765 }
766 return NULL; 766 return NULL;
767 } 767 }
OLDNEW
« no previous file with comments | « src/opts/SkColor_opts_neon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698