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

Unified Diff: src/opts/SkPMFloat_none.h

Issue 1055093002: SkPMFloat: fewer internal this->isValid() assertions. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: doc 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') | no next file » | 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 19557f11de06a8df37c4dc5dba3bd68ab42f5a0f..7f03f2f53a47a869fc34976d4edea88fe7a868c6 100644
--- a/src/opts/SkPMFloat_none.h
+++ b/src/opts/SkPMFloat_none.h
@@ -18,8 +18,9 @@ inline SkPMColor SkPMFloat::trunc() const {
}
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);
+ SkPMColor c = SkPackARGB32(this->a()+0.5f, this->r()+0.5f, this->g()+0.5f, this->b()+0.5f);
+ SkPMColorAssert(c);
+ return c;
}
inline SkPMColor SkPMFloat::clamped() const {
@@ -31,7 +32,9 @@ inline SkPMColor SkPMFloat::clamped() const {
r = r < 0 ? 0 : (r > 255 ? 255 : r);
g = g < 0 ? 0 : (g > 255 ? 255 : g);
b = b < 0 ? 0 : (b > 255 ? 255 : b);
- return SkPackARGB32(a+0.5f, r+0.5f, g+0.5f, b+0.5f);
+ SkPMColor c = SkPackARGB32(a+0.5f, r+0.5f, g+0.5f, b+0.5f);
+ SkPMColorAssert(c);
+ return c;
}
inline void SkPMFloat::From4PMColors(const SkPMColor colors[4],
« no previous file with comments | « src/opts/SkPMFloat_neon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698