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

Unified Diff: src/opts/SkPMFloat_none.h

Issue 1032243002: SkPMFloat::trunc() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove isValid assert in _none trunc() 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 | « src/opts/SkPMFloat_neon.h ('k') | tests/PMFloatTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkPMFloat_none.h
diff --git a/src/opts/SkPMFloat_none.h b/src/opts/SkPMFloat_none.h
index 00705aa582bdca2dfc09222b5100fd543fe3ce11..86516b18759c2182271306a25510a015134eb72b 100644
--- a/src/opts/SkPMFloat_none.h
+++ b/src/opts/SkPMFloat_none.h
@@ -18,6 +18,10 @@ inline SkPMFloat::SkPMFloat(SkPMColor c) {
SkASSERT(this->isValid());
}
+inline SkPMColor SkPMFloat::trunc() const {
+ return SkPackARGB32(this->a(), this->r(), this->g(), this->b());
+}
+
inline SkPMColor SkPMFloat::get() const {
SkASSERT(this->isValid());
return SkPackARGB32(this->a()+0.5f, this->r()+0.5f, this->g()+0.5f, this->b()+0.5f);
« no previous file with comments | « src/opts/SkPMFloat_neon.h ('k') | tests/PMFloatTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698