aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrColorSpaceXform.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gpu/GrColorSpaceXform.h')
-rw-r--r--include/gpu/GrColorSpaceXform.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/include/gpu/GrColorSpaceXform.h b/include/gpu/GrColorSpaceXform.h
index c1fb166f47..38b5ccfc08 100644
--- a/include/gpu/GrColorSpaceXform.h
+++ b/include/gpu/GrColorSpaceXform.h
@@ -8,43 +8,33 @@
#ifndef GrColorSpaceXform_DEFINED
#define GrColorSpaceXform_DEFINED
-#include "SkImageInfo.h"
+#include "SkMatrix44.h"
#include "SkRefCnt.h"
class SkColorSpace;
-class SkMatrix44;
/**
* Represents a color gamut transformation (as a 4x4 color matrix)
*/
class GrColorSpaceXform : public SkRefCnt {
public:
- GrColorSpaceXform(const SkMatrix44& srcToDst, SkAlphaType srcAlphaType);
+ GrColorSpaceXform(const SkMatrix44& srcToDst);
- static sk_sp<GrColorSpaceXform> Make(SkColorSpace* src, SkColorSpace* dst,
- SkAlphaType srcAlphaType);
+ static sk_sp<GrColorSpaceXform> Make(SkColorSpace* src, SkColorSpace* dst);
- const float* srcToDst() { return fSrcToDst; }
- SkAlphaType alphaType() const { return fSrcAlphaType; }
+ const SkMatrix44& srcToDst() { return fSrcToDst; }
/**
* GrGLSLFragmentProcessor::GenKey() must call this and include the returned value in its
* computed key.
*/
static uint32_t XformKey(GrColorSpaceXform* xform) {
- if (!xform) {
- return 0;
- }
- // Code generation just depends on whether the alpha type is premul or not
- return kPremul_SkAlphaType == xform->fSrcAlphaType ? 1 : 2;
+ // Code generation changes if there is an xform, but it otherwise constant
+ return SkToBool(xform) ? 1 : 0;
}
private:
- // We store the column-major form of the srcToDst matrix, for easy uploading to uniforms
- float fSrcToDst[16];
-
- // Alpha type of the source. If it's premul, we need special handling
- SkAlphaType fSrcAlphaType;
+ SkMatrix44 fSrcToDst;
};
#endif