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

Unified Diff: include/gpu/GrTextureAccess.h

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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: include/gpu/GrTextureAccess.h
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index 1b5de0ce99cc1f4e162820c03df288bce6f0f939..cf8be9a319a2a1c2dd328ed5671b0021c526a58e 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -8,6 +8,7 @@
#ifndef GrTextureAccess_DEFINED
#define GrTextureAccess_DEFINED
+#include "GrColorSpaceXform.h"
#include "GrGpuResourceRef.h"
#include "GrTexture.h"
#include "GrTextureParams.h"
@@ -25,16 +26,16 @@ public:
*/
GrTextureAccess();
- GrTextureAccess(GrTexture*, const GrTextureParams&);
+ GrTextureAccess(GrTexture*, sk_sp<GrColorSpaceXform> colorSpaceXform, const GrTextureParams&);
- explicit GrTextureAccess(GrTexture*,
+ explicit GrTextureAccess(GrTexture*, sk_sp<GrColorSpaceXform> colorSpaceXform,
GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode,
GrShaderFlags visibility = kFragment_GrShaderFlag);
- void reset(GrTexture*, const GrTextureParams&,
+ void reset(GrTexture*, sk_sp<GrColorSpaceXform> colorSpaceXform, const GrTextureParams&,
GrShaderFlags visibility = kFragment_GrShaderFlag);
- void reset(GrTexture*,
+ void reset(GrTexture*, sk_sp<GrColorSpaceXform> colorSpaceXform,
GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode,
GrShaderFlags visibility = kFragment_GrShaderFlag);
@@ -42,13 +43,15 @@ public:
bool operator==(const GrTextureAccess& that) const {
return this->getTexture() == that.getTexture() &&
fParams == that.fParams &&
- fVisibility == that.fVisibility;
+ fVisibility == that.fVisibility &&
+ fColorSpaceXform == that.fColorSpaceXform;
}
bool operator!=(const GrTextureAccess& other) const { return !(*this == other); }
GrTexture* getTexture() const { return fTexture.get(); }
GrShaderFlags getVisibility() const { return fVisibility; }
+ GrColorSpaceXform* getColorSpaceXform() const { return fColorSpaceXform.get(); }
/**
* For internal use by GrProcessor.
@@ -64,6 +67,7 @@ private:
ProgramTexture fTexture;
GrTextureParams fParams;
GrShaderFlags fVisibility;
+ sk_sp<GrColorSpaceXform> fColorSpaceXform;
typedef SkNoncopyable INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698