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

Side by Side Diff: src/core/Sk4x.h

Issue 960773005: Think implicit promotion is a good idea? (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | src/core/Sk4x_portable.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 #ifndef Sk4x_DEFINED 1 #ifndef Sk4x_DEFINED
2 #define Sk4x_DEFINED 2 #define Sk4x_DEFINED
3 3
4 #include "SkTypes.h" 4 #include "SkTypes.h"
5 5
6 #define SK4X_PREAMBLE 1 6 #define SK4X_PREAMBLE 1
7 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 7 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
8 #include "Sk4x_sse.h" 8 #include "Sk4x_sse.h"
9 #else 9 #else
10 #include "Sk4x_portable.h" 10 #include "Sk4x_portable.h"
11 #endif 11 #endif
12 #undef SK4X_PREAMBLE 12 #undef SK4X_PREAMBLE
13 13
14 template <typename T> class Sk4x; 14 template <typename T> class Sk4x;
15 typedef Sk4x<float> Sk4f; 15 typedef Sk4x<float> Sk4f;
16 typedef Sk4x<int32_t> Sk4i; 16 typedef Sk4x<int32_t> Sk4i;
17 17
18 // Some Sk4x methods are implemented only for Sk4f or Sk4i. 18 // Some Sk4x methods are implemented only for Sk4f or Sk4i.
19 // They might be unavailable, really slow, or just a bad idea. 19 // They might be unavailable, really slow, or just a bad idea.
20 // Talk to mtklein if you find yourself unable to link and 20 // Talk to mtklein if you find yourself unable to link and
21 // really need one of those methods. 21 // really need one of those methods.
22 22
23 template <typename T> class Sk4x { 23 template <typename T> class Sk4x {
24 public: 24 public:
25 Sk4x(); // Uninitialized; use Sk4x(0,0,0,0) for zero. 25 Sk4x(); // Uninitialized; use Sk4x(0) for zero.
26 /*implicit*/ Sk4x(T); // Same as Sk4x(T,T,T,T);
26 Sk4x(T, T, T, T); 27 Sk4x(T, T, T, T);
27 28
28 Sk4x(const Sk4x&); 29 Sk4x(const Sk4x&);
29 Sk4x& operator=(const Sk4x&); 30 Sk4x& operator=(const Sk4x&);
30 31
31 static Sk4x Load (const T[4]); 32 static Sk4x Load (const T[4]);
32 static Sk4x LoadAligned(const T[4]); 33 static Sk4x LoadAligned(const T[4]);
33 34
34 void store (T[4]) const; 35 void store (T[4]) const;
35 void storeAligned(T[4]) const; 36 void storeAligned(T[4]) const;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #undef SK4X_PRIVATE 84 #undef SK4X_PRIVATE
84 }; 85 };
85 86
86 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 87 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
87 #include "Sk4x_sse.h" 88 #include "Sk4x_sse.h"
88 #else 89 #else
89 #include "Sk4x_portable.h" 90 #include "Sk4x_portable.h"
90 #endif 91 #endif
91 92
92 #endif//Sk4x_DEFINED 93 #endif//Sk4x_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/Sk4x_portable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698