SRGB read and write pixels working and unit test
Review URL: https://codereview.chromium.org/1264003002
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index ac90aa1..0622e68 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -26,8 +26,6 @@
*/
class GrGLCaps : public GrCaps {
public:
-
-
typedef GrGLStencilAttachment::Format StencilFormat;
/**
@@ -254,12 +252,18 @@
bool isCoreProfile() const { return fIsCoreProfile; }
-
bool fullClearIsFree() const { return fFullClearIsFree; }
bool bindFragDataLocationSupport() const { return fBindFragDataLocationSupport; }
/**
+ * Is there support for enabling/disabling sRGB writes for sRGB-capable color attachments?
+ * If false this does not mean sRGB is not supported but rather that if it is supported
+ * it cannot be turned off for configs that support it.
+ */
+ bool srgbWriteControl() const { return fSRGBWriteControl; }
+
+ /**
* Returns a string containing the caps info.
*/
SkString dump() const override;
@@ -324,8 +328,8 @@
void initBlendEqationSupport(const GrGLContextInfo&);
void initStencilFormats(const GrGLContextInfo&);
// This must be called after initFSAASupport().
- void initConfigRenderableTable(const GrGLContextInfo&);
- void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*);
+ void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport);
+ void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*, bool srgbSupport);
bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLenum type) const;
@@ -375,6 +379,7 @@
bool fIsCoreProfile : 1;
bool fFullClearIsFree : 1;
bool fBindFragDataLocationSupport : 1;
+ bool fSRGBWriteControl : 1;
struct ReadPixelsSupportedFormat {
GrGLenum fFormat;