Skia's ColorMatrix vector is in the 0..255 range not 0..1
Bug #7248980 Change-Id: I9873540e3bc1ea0526ea0884279a427c0de96006
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user