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

Unified Diff: src/gpu/glsl/GrGLSLColorSpaceXformHelper.h

Issue 2180803005: Add color gamut xform helpers to GrGLSLShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@xform-storage
Patch Set: Rebase Created 4 years, 3 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
Index: src/gpu/glsl/GrGLSLColorSpaceXformHelper.h
diff --git a/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h b/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h
index 940be571260f51969ed1576ace6feb56db259e1e..cd516e8c8917ab0c338f9725495b713d981d3560 100644
--- a/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h
+++ b/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h
@@ -8,12 +8,13 @@
#ifndef GrGLSLColorSpaceXformHelper_DEFINED
#define GrGLSLColorSpaceXformHelper_DEFINED
+#include "GrColorSpaceXform.h"
#include "GrGLSLUniformHandler.h"
-class GrColorSpaceXform;
-
/**
* Stack helper class to assist with using GrColorSpaceXform within an FP's emitCode function.
+ * This injects the uniform declaration, and stores the information needed to generate correct
+ * gamut-transformation shader code.
*/
class GrGLSLColorSpaceXformHelper : public SkNoncopyable {
public:
@@ -25,15 +26,18 @@ public:
*handle = uniformHandler->addUniform(kFragment_GrShaderFlag, kMat44f_GrSLType,
kDefault_GrSLPrecision, "ColorXform",
&fXformMatrix);
+ fAlphaType = colorSpaceXform->alphaType();
} else {
fXformMatrix = nullptr;
}
}
const char* getXformMatrix() const { return fXformMatrix; }
+ SkAlphaType alphaType() const { return fAlphaType; }
private:
const char* fXformMatrix;
+ SkAlphaType fAlphaType;
};
#endif

Powered by Google App Engine
This is Rietveld 408576698