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

Side by Side Diff: src/opts/Sk4px_none.h

Issue 1230663005: 3-15% speedup to HardLight / Overlay xfermodes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add a test that widenLo() | widenHi() == widenLoHi() Created 5 years, 5 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
« no previous file with comments | « src/opts/Sk4px_SSE2.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkUtils.h" 8 #include "SkUtils.h"
9 9
10 namespace { // See Sk4px.h 10 namespace { // See Sk4px.h
(...skipping 30 matching lines...) Expand all
41 41
42 inline Sk4px::Wide Sk4px::widenLo() const { 42 inline Sk4px::Wide Sk4px::widenLo() const {
43 return Sk16h(this->kth< 0>(), this->kth< 1>(), this->kth< 2>(), this->kth< 3 >(), 43 return Sk16h(this->kth< 0>(), this->kth< 1>(), this->kth< 2>(), this->kth< 3 >(),
44 this->kth< 4>(), this->kth< 5>(), this->kth< 6>(), this->kth< 7 >(), 44 this->kth< 4>(), this->kth< 5>(), this->kth< 6>(), this->kth< 7 >(),
45 this->kth< 8>(), this->kth< 9>(), this->kth<10>(), this->kth<11 >(), 45 this->kth< 8>(), this->kth< 9>(), this->kth<10>(), this->kth<11 >(),
46 this->kth<12>(), this->kth<13>(), this->kth<14>(), this->kth<15 >()); 46 this->kth<12>(), this->kth<13>(), this->kth<14>(), this->kth<15 >());
47 } 47 }
48 48
49 inline Sk4px::Wide Sk4px::widenHi() const { return this->widenLo() << 8; } 49 inline Sk4px::Wide Sk4px::widenHi() const { return this->widenLo() << 8; }
50 50
51 inline Sk4px::Wide Sk4px::widenLoHi() const { return this->widenLo() + this->wid enHi(); }
52
51 inline Sk4px::Wide Sk4px::mulWiden(const Sk16b& other) const { 53 inline Sk4px::Wide Sk4px::mulWiden(const Sk16b& other) const {
52 return this->widenLo() * Sk4px(other).widenLo(); 54 return this->widenLo() * Sk4px(other).widenLo();
53 } 55 }
54 56
55 inline Sk4px Sk4px::Wide::addNarrowHi(const Sk16h& other) const { 57 inline Sk4px Sk4px::Wide::addNarrowHi(const Sk16h& other) const {
56 Sk4px::Wide r = (*this + other) >> 8; 58 Sk4px::Wide r = (*this + other) >> 8;
57 return Sk16b(r.kth< 0>(), r.kth< 1>(), r.kth< 2>(), r.kth< 3>(), 59 return Sk16b(r.kth< 0>(), r.kth< 1>(), r.kth< 2>(), r.kth< 3>(),
58 r.kth< 4>(), r.kth< 5>(), r.kth< 6>(), r.kth< 7>(), 60 r.kth< 4>(), r.kth< 5>(), r.kth< 6>(), r.kth< 7>(),
59 r.kth< 8>(), r.kth< 9>(), r.kth<10>(), r.kth<11>(), 61 r.kth< 8>(), r.kth< 9>(), r.kth<10>(), r.kth<11>(),
60 r.kth<12>(), r.kth<13>(), r.kth<14>(), r.kth<15>()); 62 r.kth<12>(), r.kth<13>(), r.kth<14>(), r.kth<15>());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 94
93 inline Sk4px Sk4px::zeroColors() const { 95 inline Sk4px Sk4px::zeroColors() const {
94 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); 96 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
95 return Sk16b(0,0,0, this->kth< 3>(), 97 return Sk16b(0,0,0, this->kth< 3>(),
96 0,0,0, this->kth< 7>(), 98 0,0,0, this->kth< 7>(),
97 0,0,0, this->kth<11>(), 99 0,0,0, this->kth<11>(),
98 0,0,0, this->kth<15>()); 100 0,0,0, this->kth<15>());
99 } 101 }
100 102
101 } // namespace 103 } // namespace
OLDNEW
« no previous file with comments | « src/opts/Sk4px_SSE2.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698