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

Unified Diff: src/opts/SkPMFloat_sse.h

Issue 1286093004: Refactor to put SkXfermode_opts inside SK_OPTS_NS. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « src/opts/SkPMFloat_none.h ('k') | src/opts/SkXfermode_opts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkPMFloat_sse.h
diff --git a/src/opts/SkPMFloat_sse.h b/src/opts/SkPMFloat_sse.h
index 28aa90bf29fd8d4913417f8111d92f1bc9b23448..016644e0524255ed7a65918cf2753ad7ed28bb7d 100644
--- a/src/opts/SkPMFloat_sse.h
+++ b/src/opts/SkPMFloat_sse.h
@@ -5,9 +5,7 @@
* found in the LICENSE file.
*/
-namespace { // See SkPMFloat.h
-
-inline SkPMFloat::SkPMFloat(SkPMColor c) {
+SK_ALWAYS_INLINE SkPMFloat::SkPMFloat(SkPMColor c) {
SkPMColorAssert(c);
#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3
const int _ = 255; // Zero these bytes.
@@ -22,7 +20,7 @@ inline SkPMFloat::SkPMFloat(SkPMColor c) {
SkASSERT(this->isValid());
}
-inline SkPMColor SkPMFloat::round() const {
+SK_ALWAYS_INLINE SkPMColor SkPMFloat::round() const {
// We don't use _mm_cvtps_epi32, because we want precise control over how 0.5 rounds (up).
__m128 scaled = _mm_mul_ps(_mm_set1_ps(255), fVec);
__m128i fix8_32 = _mm_cvttps_epi32(_mm_add_ps(_mm_set1_ps(0.5f), scaled)),
@@ -33,9 +31,7 @@ inline SkPMColor SkPMFloat::round() const {
return c;
}
-inline Sk4f SkPMFloat::alphas() const {
+SK_ALWAYS_INLINE Sk4f SkPMFloat::alphas() const {
static_assert(SK_A32_SHIFT == 24, "");
return _mm_shuffle_ps(fVec, fVec, 0xff); // Read as 11 11 11 11, copying lane 3 to all lanes.
}
-
-} // namespace
« no previous file with comments | « src/opts/SkPMFloat_none.h ('k') | src/opts/SkXfermode_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698