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

Unified Diff: src/core/Sk4x.h

Issue 1001453006: Add Load2/store2 to Sk4x (dumb impl for now) (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/Sk4xTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/Sk4x.h
diff --git a/src/core/Sk4x.h b/src/core/Sk4x.h
index 0b9796db9b9bb1e42ee23606e27f3f9deeb4952a..401bbd857b1ce176c3820ecb8d87f0a15180019c 100644
--- a/src/core/Sk4x.h
+++ b/src/core/Sk4x.h
@@ -37,6 +37,18 @@ public:
void store (T[4]) const;
void storeAligned(T[4]) const;
+ // Experimental!
+ static Sk4x Load2(const T src[2]) {
+ const T padded[4] = { src[0], src[1], 0, 0 };
+ return Load(padded);
+ }
+ void store2(T dst[2]) const {
+ T padded[4];
+ this->store(padded);
+ dst[0] = padded[0];
+ dst[1] = padded[1];
+ }
+
template <typename Dst> Dst reinterpret() const;
template <typename Dst> Dst cast() const;
« no previous file with comments | « no previous file | tests/Sk4xTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698