OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
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 "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
9 #include "SkColor_opts_SSE2.h" | 9 #include "SkColor_opts_SSE2.h" |
10 #include "SkMathPriv.h" | 10 #include "SkMathPriv.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 | 637 |
638 //////////////////////////////////////////////////////////////////////////////// | 638 //////////////////////////////////////////////////////////////////////////////// |
639 | 639 |
640 typedef __m128i (*SkXfermodeProcSIMD)(const __m128i& src, const __m128i& dst); | 640 typedef __m128i (*SkXfermodeProcSIMD)(const __m128i& src, const __m128i& dst); |
641 | 641 |
642 extern SkXfermodeProcSIMD gSSE2XfermodeProcs[]; | 642 extern SkXfermodeProcSIMD gSSE2XfermodeProcs[]; |
643 | 643 |
644 SkSSE2ProcCoeffXfermode::SkSSE2ProcCoeffXfermode(SkReadBuffer& buffer) | 644 SkSSE2ProcCoeffXfermode::SkSSE2ProcCoeffXfermode(SkReadBuffer& buffer) |
645 : INHERITED(buffer) { | 645 : INHERITED(buffer) { |
646 fProcSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[this->getMode()]); | 646 fProcSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[this->getMode()]); |
647 buffer.validate(fProcSIMD != NULL); | |
Stephen White
2014/06/02 13:13:35
Not new to this patch, but I wonder why we have su
| |
647 } | 648 } |
648 | 649 |
649 void SkSSE2ProcCoeffXfermode::xfer32(SkPMColor dst[], const SkPMColor src[], | 650 void SkSSE2ProcCoeffXfermode::xfer32(SkPMColor dst[], const SkPMColor src[], |
650 int count, const SkAlpha aa[]) const { | 651 int count, const SkAlpha aa[]) const { |
651 SkASSERT(dst && src && count >= 0); | 652 SkASSERT(dst && src && count >= 0); |
652 | 653 |
653 SkXfermodeProc proc = this->getProc(); | 654 SkXfermodeProc proc = this->getProc(); |
654 SkXfermodeProcSIMD procSIMD = reinterpret_cast<SkXfermodeProcSIMD>(fProcSIMD ); | 655 SkXfermodeProcSIMD procSIMD = reinterpret_cast<SkXfermodeProcSIMD>(fProcSIMD ); |
655 SkASSERT(procSIMD != NULL); | 656 SkASSERT(procSIMD != NULL); |
656 | 657 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
809 | 810 |
810 SkProcCoeffXfermode* SkPlatformXfermodeFactory_impl_SSE2(const ProcCoeff& rec, | 811 SkProcCoeffXfermode* SkPlatformXfermodeFactory_impl_SSE2(const ProcCoeff& rec, |
811 SkXfermode::Mode mode) { | 812 SkXfermode::Mode mode) { |
812 void* procSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[mode]); | 813 void* procSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[mode]); |
813 | 814 |
814 if (procSIMD != NULL) { | 815 if (procSIMD != NULL) { |
815 return SkNEW_ARGS(SkSSE2ProcCoeffXfermode, (rec, mode, procSIMD)); | 816 return SkNEW_ARGS(SkSSE2ProcCoeffXfermode, (rec, mode, procSIMD)); |
816 } | 817 } |
817 return NULL; | 818 return NULL; |
818 } | 819 } |
OLD | NEW |