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

Unified Diff: src/core/SkColor.cpp

Issue 1642703003: starter procs for blending with pm4f (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: int to float Created 4 years, 11 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
Index: src/core/SkColor.cpp
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index 1794cd7d909c68a23f102d25cfe9e4c73ed0ed2f..9deac7a197689d9bd2f5a41b8c8bb9e429a49b48 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -141,3 +141,8 @@ SkPM4f SkColor4f::premul() const {
dst.store(pm4.fVec);
return pm4;
}
+
+bool SkPM4f::isUnit() const {
mtklein 2016/01/29 15:23:00 If this is only used inside asserts, we may want t
reed1 2016/01/29 22:35:27 Gotcha. No idea if we'll need it for real, so for
+ auto c4 = Sk4f::Load(fVec);
+ return (c4 >= Sk4f(0)).allTrue() && (c4 <= Sk4f(1)).allTrue();
+}

Powered by Google App Engine
This is Rietveld 408576698