Chromium Code Reviews| Index: src/gpu/GrTextureParamsAdjuster.h |
| diff --git a/src/gpu/GrTextureParamsAdjuster.h b/src/gpu/GrTextureParamsAdjuster.h |
| index c9b90a59ffff31fd57ab8f52a8031259283047d0..cd38cacc43200426d088d9bcee967cc1584208d3 100644 |
| --- a/src/gpu/GrTextureParamsAdjuster.h |
| +++ b/src/gpu/GrTextureParamsAdjuster.h |
| @@ -69,7 +69,12 @@ protected: |
| typedef SkNoncopyable INHERITED; |
| }; |
| -/** Base class for sources that start out as textures */ |
| +/** |
| + * Base class for sources that start out as textures. Optionally allows for a content area subrect. |
|
robertphillips
2015/10/29 17:54:52
not to use -> is to not use ?
WDYT about a debug
bsalomon
2015/10/29 19:14:20
Done.
|
| + * The intent not to use the content area for subrect rendering. Rather the pixels outside the |
| + * content area have undefined values and shouldn't be read *regardless* of filtering mode or |
| + * the SkCanvas::SrcRectConstraint used for subrect draws. |
| + */ |
| class GrTextureAdjuster : public GrTextureProducer { |
| public: |
| /** Makes the subset of the texture safe to use with the given texture parameters. |
| @@ -79,20 +84,18 @@ public: |
| GrTexture* refTextureSafeForParams(const GrTextureParams&, SkIPoint* outOffset); |
| protected: |
| - /** No subset, use the whole texture */ |
| + /** The whole texture is content. */ |
| explicit GrTextureAdjuster(GrTexture* original): fOriginal(original) {} |
| - GrTextureAdjuster(GrTexture* original, const SkIRect& subset); |
| + GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea); |
| GrTexture* originalTexture() { return fOriginal; } |
| - /** Returns the subset or null for the whole original texture */ |
| - const SkIRect* subset() { return fSubset.getMaybeNull(); } |
| + /** Returns the content area or null for the whole original texture */ |
| + const SkIRect* contentArea() { return fContentArea.getMaybeNull(); } |
| private: |
| - GrTexture* internalRefTextureSafeForParams(GrTexture*, const SkIRect* subset, |
| - const GrTextureParams&, SkIPoint* outOffset); |
| - SkTLazy<SkIRect> fSubset; |
| + SkTLazy<SkIRect> fContentArea; |
| GrTexture* fOriginal; |
| typedef GrTextureProducer INHERITED; |