Two changes:
1. Remove special premul handling from gamut xform code
Alpha is a constant, so the gamut transformation results remain unchanged
(it distributes across the linear matrix multiply).
2. Use SkMatrix44 rather than array of floats
Preserves semantic intention, and makes upcoming code (where we transform
colors on the CPU by that matrix) simpler.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2329553002
Review-Url: https://codereview.chromium.org/2329553002
diff --git a/src/gpu/glsl/GrGLSLProgramDataManager.cpp b/src/gpu/glsl/GrGLSLProgramDataManager.cpp
index 0c98e08..0803f7a 100644
--- a/src/gpu/glsl/GrGLSLProgramDataManager.cpp
+++ b/src/gpu/glsl/GrGLSLProgramDataManager.cpp
@@ -8,6 +8,7 @@
#include "glsl/GrGLSLProgramDataManager.h"
#include "SkMatrix.h"
+#include "SkMatrix44.h"
void GrGLSLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) const {
float mt[] = {
@@ -23,3 +24,10 @@
};
this->setMatrix3f(u, mt);
}
+
+void GrGLSLProgramDataManager::setSkMatrix44(UniformHandle u, const SkMatrix44& matrix) const {
+ // TODO: We could skip this temporary buffer if we had direct access to the matrix storage
+ float m[16];
+ matrix.asColMajorf(m);
+ this->setMatrix4f(u, m);
+}