aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureParamsAdjuster.h
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-06 13:10:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-06 13:10:58 -0700
commit982eb7f377a0c771345276558072deb2fcea0d3e (patch)
tree02ae878610160d6b6c91629424aaf895e5f17497 /src/gpu/GrTextureParamsAdjuster.h
parentdc27a648d2ff23b2e96232c00c15976c46e1d48d (diff)
Add new SkSourceGammaTreatment enum, used in situations like mipmap construction, where we need to know if we should respect (vs. ignore) the gamma encoding of sRGB tagged images. Plumb that extensively.
Diffstat (limited to 'src/gpu/GrTextureParamsAdjuster.h')
-rw-r--r--src/gpu/GrTextureParamsAdjuster.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gpu/GrTextureParamsAdjuster.h b/src/gpu/GrTextureParamsAdjuster.h
index c02f5b34f7..5f0f2715be 100644
--- a/src/gpu/GrTextureParamsAdjuster.h
+++ b/src/gpu/GrTextureParamsAdjuster.h
@@ -64,7 +64,8 @@ public:
const SkRect& constraintRect,
FilterConstraint filterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic) = 0;
+ const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ SkSourceGammaTreatment) = 0;
virtual ~GrTextureProducer() {}
@@ -127,14 +128,16 @@ public:
outOffset will be the top-left corner of the subset if a copy is not made. Otherwise,
the copy will be tight to the contents and outOffset will be (0, 0). If the copy's size
does not match subset's dimensions then the contents are scaled to fit the copy.*/
- GrTexture* refTextureSafeForParams(const GrTextureParams&, SkIPoint* outOffset);
+ GrTexture* refTextureSafeForParams(const GrTextureParams&, SkSourceGammaTreatment,
+ SkIPoint* outOffset);
const GrFragmentProcessor* createFragmentProcessor(
const SkMatrix& textureMatrix,
const SkRect& constraintRect,
FilterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic) override;
+ const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ SkSourceGammaTreatment) override;
protected:
/** The whole texture is content. */
@@ -167,14 +170,15 @@ public:
/** Returns a texture that is safe for use with the params. If the size of the returned texture
does not match width()/height() then the contents of the original must be scaled to fit
the texture. */
- GrTexture* refTextureForParams(const GrTextureParams&);
+ GrTexture* refTextureForParams(const GrTextureParams&, SkSourceGammaTreatment);
const GrFragmentProcessor* createFragmentProcessor(
const SkMatrix& textureMatrix,
const SkRect& constraintRect,
FilterConstraint filterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic) override;
+ const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ SkSourceGammaTreatment) override;
protected:
GrTextureMaker(GrContext* context, int width, int height, bool isAlphaOnly)
@@ -185,7 +189,7 @@ protected:
* Return the maker's "original" texture. It is the responsibility of the maker to handle any
* caching of the original if desired.
*/
- virtual GrTexture* refOriginalTexture(bool willBeMipped) = 0;
+ virtual GrTexture* refOriginalTexture(bool willBeMipped, SkSourceGammaTreatment) = 0;
/**
* Return a new (uncached) texture that is the stretch of the maker's original.
@@ -197,7 +201,8 @@ protected:
* Subclass may override this if they can handle creating the texture more directly than
* by copying.
*/
- virtual GrTexture* generateTextureForParams(const CopyParams&, bool willBeMipped);
+ virtual GrTexture* generateTextureForParams(const CopyParams&, bool willBeMipped,
+ SkSourceGammaTreatment);
GrContext* context() const { return fContext; }