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

Unified Diff: src/core/SkPMFloat.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 | « no previous file | src/opts/SkPMFloat_SSE2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPMFloat.h
diff --git a/src/core/SkPMFloat.h b/src/core/SkPMFloat.h
index 31478794580a23898fcde867626a28904590909f..84c05ea762f7cd4afd9f24586d9a263ebd231622 100644
--- a/src/core/SkPMFloat.h
+++ b/src/core/SkPMFloat.h
@@ -43,9 +43,11 @@ public:
float g() const { return fColors[SK_G32_SHIFT / 8]; }
float b() const { return fColors[SK_B32_SHIFT / 8]; }
+ // N.B. All methods returning an SkPMColor call SkPMColorAssert on that result before returning.
+
// get() and clamped() round component values to the nearest integer.
- SkPMColor get() const; // May SkASSERT(this->isValid()). Some implementations may clamp.
- SkPMColor clamped() const; // Will clamp all values to [0, 255]. Then may assert isValid().
+ SkPMColor get() const; // Assumes all values in [0, 255]. Some implementations may clamp.
+ SkPMColor clamped() const; // Will clamp all values to [0, 255].
// Like get(), but truncates instead of rounding.
// The domain of this function is (-1.0f, 256.0f). Values in (-1.0f, 0.0f] trunc to a zero.
« no previous file with comments | « no previous file | src/opts/SkPMFloat_SSE2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698