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

Unified Diff: src/core/SkPMFloat.h

Issue 1026403002: Go back to storeAligned / LoadAligned for SkPMFloat <->Sk4f. (Closed) Base URL: https://skia.googlesource.com/skia@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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/PMFloatTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPMFloat.h
diff --git a/src/core/SkPMFloat.h b/src/core/SkPMFloat.h
index 699f85b2c4f74ef7209a08eafddf2621f8b1801c..010974debe2905f87b6f55a4b0e73bea8fbc697c 100644
--- a/src/core/SkPMFloat.h
+++ b/src/core/SkPMFloat.h
@@ -38,8 +38,8 @@ public:
SkPMFloat& operator=(const SkPMFloat& that);
// Freely autoconvert between SkPMFloat and Sk4f. They're always byte-for-byte identical.
- /*implicit*/ SkPMFloat(const Sk4f& fs) { *(Sk4f*)this = fs; }
- /*implicit*/ operator Sk4f() const { return *(const Sk4f*)this; }
+ /*implicit*/ SkPMFloat(const Sk4f& fs) { fs.storeAligned(fColor); }
+ /*implicit*/ operator Sk4f() const { return Sk4f::LoadAligned(fColor); }
float a() const { return fColor[SK_A32_SHIFT / 8]; }
float r() const { return fColor[SK_R32_SHIFT / 8]; }
« no previous file with comments | « no previous file | tests/PMFloatTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698