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

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

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify xfermodes, fix SkLayerDrawLooper Created 6 years, 4 months 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
OLDNEW
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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 SkGetPackedB32_SSE2(dst), sa, da); 634 SkGetPackedB32_SSE2(dst), sa, da);
635 return SkPackARGB32_SSE2(a, r, g, b); 635 return SkPackARGB32_SSE2(a, r, g, b);
636 } 636 }
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 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
645 : INHERITED(buffer) { 645 SkSSE2ProcCoeffXfermode::SkSSE2ProcCoeffXfermode(SkReadBuffer& buffer) : INHERIT ED(buffer) {
646 fProcSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[this->getMode()]); 646 fProcSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[this->getMode()]);
647 buffer.validate(fProcSIMD != NULL); 647 buffer.validate(fProcSIMD != NULL);
648 } 648 }
649 #endif
649 650
650 void SkSSE2ProcCoeffXfermode::xfer32(SkPMColor dst[], const SkPMColor src[], 651 void SkSSE2ProcCoeffXfermode::xfer32(SkPMColor dst[], const SkPMColor src[],
651 int count, const SkAlpha aa[]) const { 652 int count, const SkAlpha aa[]) const {
652 SkASSERT(dst && src && count >= 0); 653 SkASSERT(dst && src && count >= 0);
653 654
654 SkXfermodeProc proc = this->getProc(); 655 SkXfermodeProc proc = this->getProc();
655 SkXfermodeProcSIMD procSIMD = reinterpret_cast<SkXfermodeProcSIMD>(fProcSIMD ); 656 SkXfermodeProcSIMD procSIMD = reinterpret_cast<SkXfermodeProcSIMD>(fProcSIMD );
656 SkASSERT(procSIMD != NULL); 657 SkASSERT(procSIMD != NULL);
657 658
658 if (NULL == aa) { 659 if (NULL == aa) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 811
811 SkProcCoeffXfermode* SkPlatformXfermodeFactory_impl_SSE2(const ProcCoeff& rec, 812 SkProcCoeffXfermode* SkPlatformXfermodeFactory_impl_SSE2(const ProcCoeff& rec,
812 SkXfermode::Mode mode) { 813 SkXfermode::Mode mode) {
813 void* procSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[mode]); 814 void* procSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[mode]);
814 815
815 if (procSIMD != NULL) { 816 if (procSIMD != NULL) {
816 return SkNEW_ARGS(SkSSE2ProcCoeffXfermode, (rec, mode, procSIMD)); 817 return SkNEW_ARGS(SkSSE2ProcCoeffXfermode, (rec, mode, procSIMD));
817 } 818 }
818 return NULL; 819 return NULL;
819 } 820 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698