OLD | NEW |
1 #ifndef SkPM_DEFINED | 1 #ifndef SkPM_DEFINED |
2 #define SkPM_DEFINED | 2 #define SkPM_DEFINED |
3 | 3 |
4 #include "SkTypes.h" | 4 #include "SkTypes.h" |
5 #include "SkColor.h" | 5 #include "SkColor.h" |
6 #include "SkColorPriv.h" | 6 #include "SkColorPriv.h" |
7 #include "Sk4x.h" | 7 #include "Sk4x.h" |
8 | 8 |
9 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 9 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
10 #include <immintrin.h> | 10 #include <immintrin.h> |
11 #elif defined(SK_ARM_HAS_NEON) | 11 #elif defined(__ARM_NEON__) |
12 #include <arm_neon.h> | 12 #include <arm_neon.h> |
13 #endif | 13 #endif |
14 | 14 |
15 // A pre-multiplied color storing each component in the same order as SkPMColor, | 15 // A pre-multiplied color storing each component in the same order as SkPMColor, |
16 // but as a float in the range [0, 255]. | 16 // but as a float in the range [0, 255]. |
17 class SK_STRUCT_ALIGN(16) SkPMFloat { | 17 class SK_STRUCT_ALIGN(16) SkPMFloat { |
18 public: | 18 public: |
19 static SkPMFloat FromPMColor(SkPMColor c) { return SkPMFloat(c); } | 19 static SkPMFloat FromPMColor(SkPMColor c) { return SkPMFloat(c); } |
20 static SkPMFloat FromARGB(float a, float r, float g, float b) { return SkPMF
loat(a,r,g,b); } | 20 static SkPMFloat FromARGB(float a, float r, float g, float b) { return SkPMF
loat(a,r,g,b); } |
21 | 21 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 && this->r() >= 0 && this->r() <= this->a() | 59 && this->r() >= 0 && this->r() <= this->a() |
60 && this->g() >= 0 && this->g() <= this->a() | 60 && this->g() >= 0 && this->g() <= this->a() |
61 && this->b() >= 0 && this->b() <= this->a(); | 61 && this->b() >= 0 && this->b() <= this->a(); |
62 } | 62 } |
63 | 63 |
64 private: | 64 private: |
65 union { | 65 union { |
66 float fColor[4]; | 66 float fColor[4]; |
67 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 67 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
68 __m128 fColors; | 68 __m128 fColors; |
69 #elif defined(SK_ARM_HAS_NEON) | 69 #elif defined(__ARM_NEON__) |
70 float32x4_t fColors; | 70 float32x4_t fColors; |
71 #endif | 71 #endif |
72 }; | 72 }; |
73 }; | 73 }; |
74 | 74 |
75 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | 75 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 |
76 #include "../opts/SkPMFloat_SSSE3.h" | 76 #include "../opts/SkPMFloat_SSSE3.h" |
77 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 77 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
78 #include "../opts/SkPMFloat_SSE2.h" | 78 #include "../opts/SkPMFloat_SSE2.h" |
79 #elif defined(SK_ARM_HAS_NEON) | 79 #elif defined(__ARM_NEON__) |
80 #include "../opts/SkPMFloat_neon.h" | 80 #include "../opts/SkPMFloat_neon.h" |
81 #else | 81 #else |
82 #include "../opts/SkPMFloat_none.h" | 82 #include "../opts/SkPMFloat_none.h" |
83 #endif | 83 #endif |
84 | 84 |
85 #endif//SkPM_DEFINED | 85 #endif//SkPM_DEFINED |
OLD | NEW |