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

Unified Diff: src/effects/SkColorMatrixFilter.cpp

Issue 1634273002: float components in xfermodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable blitter for official checkin 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
« src/core/SkXfermode4f.cpp ('K') | « src/core/SkXfermode4f.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 980412b8dd78ec2fffe398b9592cd2733856e4c6..4bc07b39db61484c2bc0ccb1a6a5d9cd8a6ed132 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -68,16 +68,16 @@ uint32_t SkColorMatrixFilter::getFlags() const {
}
static Sk4f scale_rgb(float scale) {
- static_assert(SK_A32_SHIFT == 24, "Alpha is lane 3");
+ static_assert(SkPM4f::A == 3, "Alpha is lane 3");
return Sk4f(scale, scale, scale, 1);
}
static Sk4f premul(const Sk4f& x) {
- return x * scale_rgb(x.kth<SK_A32_SHIFT/8>());
+ return x * scale_rgb(x.kth<SkPM4f::A>());
}
static Sk4f unpremul(const Sk4f& x) {
- return x * scale_rgb(1 / x.kth<SK_A32_SHIFT/8>()); // TODO: fast/approx invert?
+ return x * scale_rgb(1 / x.kth<SkPM4f::A>()); // TODO: fast/approx invert?
}
static Sk4f clamp_0_1(const Sk4f& x) {
@@ -105,7 +105,7 @@ void filter_span(const float array[], const T src[], int count, T dst[]) {
for (int i = 0; i < count; i++) {
Sk4f srcf = Adaptor::To4f(src[i]);
- float srcA = srcf.kth<SK_A32_SHIFT/8>();
+ float srcA = srcf.kth<SkPM4f::A>();
if (0 == srcA) {
dst[i] = matrix_translate_pmcolor;
« src/core/SkXfermode4f.cpp ('K') | « src/core/SkXfermode4f.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698