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

Unified Diff: src/opts/SkPMFloat_neon.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/SkOpts_sse2.cpp ('k') | src/opts/SkPMFloat_none.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkPMFloat_neon.h
diff --git a/src/opts/SkPMFloat_neon.h b/src/opts/SkPMFloat_neon.h
index 8bee5b551aebb708c09b7557ae74ea6a8618f083..edbbc58b5accf869a15a83bfd938b738159f04c6 100644
--- a/src/opts/SkPMFloat_neon.h
+++ b/src/opts/SkPMFloat_neon.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);
uint8x8_t fix8 = (uint8x8_t)vdup_n_u32(c);
uint16x8_t fix8_16 = vmovl_u8(fix8);
@@ -16,7 +14,7 @@ inline SkPMFloat::SkPMFloat(SkPMColor c) {
SkASSERT(this->isValid());
}
-inline SkPMColor SkPMFloat::round() const {
+SK_ALWAYS_INLINE SkPMColor SkPMFloat::round() const {
// vcvt_u32_f32 truncates, so we round manually by adding a half before converting.
float32x4_t rounded = vmlaq_f32(vdupq_n_f32(0.5f), fVec, vdupq_n_f32(255));
uint32x4_t fix8_32 = vcvtq_u32_f32(rounded);
@@ -27,9 +25,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, "Assuming little-endian.");
return vdupq_lane_f32(vget_high_f32(fVec), 1); // Duplicate high lane of high half i.e. lane 3.
}
-
-} // namespace
« no previous file with comments | « src/opts/SkOpts_sse2.cpp ('k') | src/opts/SkPMFloat_none.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698