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

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

Issue 1015083004: SkPMFloat: avoid loads and stores where possible. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/SkPMFloat_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 "SkColorPriv.h" 1 inline SkPMFloat& SkPMFloat::operator=(const SkPMFloat& that) {
2 for (int i = 0; i < 4; i++) { fColor[i] = that.fColor[i]; }
3 return *this;
4 }
2 5
3 inline SkPMFloat::SkPMFloat(SkPMColor c) { 6 inline SkPMFloat::SkPMFloat(SkPMColor c) {
4 *this = SkPMFloat::FromARGB(SkGetPackedA32(c), 7 *this = SkPMFloat::FromARGB(SkGetPackedA32(c),
5 SkGetPackedR32(c), 8 SkGetPackedR32(c),
6 SkGetPackedG32(c), 9 SkGetPackedG32(c),
7 SkGetPackedB32(c)); 10 SkGetPackedB32(c));
8 SkASSERT(this->isValid()); 11 SkASSERT(this->isValid());
9 } 12 }
10 13
11 inline SkPMColor SkPMFloat::get() const { 14 inline SkPMColor SkPMFloat::get() const {
(...skipping 17 matching lines...) Expand all
29 for (int i = 0; i < 4; i++) { floats[i] = FromPMColor(colors[i]); } 32 for (int i = 0; i < 4; i++) { floats[i] = FromPMColor(colors[i]); }
30 } 33 }
31 34
32 inline void SkPMFloat::To4PMColors(SkPMColor colors[4], const SkPMFloat floats[4 ]) { 35 inline void SkPMFloat::To4PMColors(SkPMColor colors[4], const SkPMFloat floats[4 ]) {
33 for (int i = 0; i < 4; i++) { colors[i] = floats[i].get(); } 36 for (int i = 0; i < 4; i++) { colors[i] = floats[i].get(); }
34 } 37 }
35 38
36 inline void SkPMFloat::ClampTo4PMColors(SkPMColor colors[4], const SkPMFloat flo ats[4]) { 39 inline void SkPMFloat::ClampTo4PMColors(SkPMColor colors[4], const SkPMFloat flo ats[4]) {
37 for (int i = 0; i < 4; i++) { colors[i] = floats[i].clamped(); } 40 for (int i = 0; i < 4; i++) { colors[i] = floats[i].clamped(); }
38 } 41 }
OLDNEW
« no previous file with comments | « src/opts/SkPMFloat_neon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698