Skia's ColorMatrix vector is in the 0..255 range not 0..1

Bug #7248980

Change-Id: I9873540e3bc1ea0526ea0884279a427c0de96006
This commit is contained in:
Romain Guy
2012-09-27 18:06:43 -07:00
parent 54c1a64d54
commit 6ed9e43879

View File

@@ -36,6 +36,12 @@ SkiaColorFilter::~SkiaColorFilter() {
SkiaColorMatrixFilter::SkiaColorMatrixFilter(SkColorFilter* skFilter, float* matrix, float* vector):
SkiaColorFilter(skFilter, kColorMatrix, true), mMatrix(matrix), mVector(vector) {
// Skia uses the range [0..255] for the addition vector, but we need
// the [0..1] range to apply the vector in GLSL
for (int i = 0; i < 4; i++) {
mVector[i] /= 255.0f;
}
// TODO: We should be smarter about this
mBlend = true;
}