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

Unified Diff: src/gpu/GrTextureParamsAdjuster.h

Issue 1410383008: Clarify subrect semantics for GrTextureAdjuster and handle mip maps correctly. (Closed) Base URL: https://skia.googlesource.com/skia.git@producer
Patch Set: Address comment Created 5 years, 2 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
« no previous file with comments | « no previous file | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextureParamsAdjuster.h
diff --git a/src/gpu/GrTextureParamsAdjuster.h b/src/gpu/GrTextureParamsAdjuster.h
index c9b90a59ffff31fd57ab8f52a8031259283047d0..f8fdc2d4fbe62fd53046d1309611c07d16303af6 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.
+ * The intent is not to use 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;
« no previous file with comments | « no previous file | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698