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

Unified Diff: src/gpu/GrTextureParamsAdjuster.h

Issue 1424313010: Separate out natively-texture image/bmp draws from cached-as-texture image/bmp draws (Closed) Base URL: https://skia.googlesource.com/skia.git@const
Patch Set: tiny Created 5 years, 1 month 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: src/gpu/GrTextureParamsAdjuster.h
diff --git a/src/gpu/GrTextureParamsAdjuster.h b/src/gpu/GrTextureParamsAdjuster.h
index f8fdc2d4fbe62fd53046d1309611c07d16303af6..3ef1d30150ad7720c76fec96acde71988aedbef9 100644
--- a/src/gpu/GrTextureParamsAdjuster.h
+++ b/src/gpu/GrTextureParamsAdjuster.h
@@ -83,14 +83,42 @@ public:
does not match subset's dimensions then the contents are scaled to fit the copy.*/
GrTexture* refTextureSafeForParams(const GrTextureParams&, SkIPoint* outOffset);
+ enum FilterConstraint {
+ kYes_FilterConstraint,
+ kNo_FilterConstraint,
+ };
+
+ /**
+ * Helper for creating a fragment processor to sample the texture with a given filtering mode.
+ * It attempts to avoids making a copy of the texture and avoid using a texture domain unless
+ * necessary.
+ *
+ * @param textureMatrix Matrix to transform local coords by to compute
+ * texture coords.
+ * @param constraintRect Subrect of content area to be rendered. Must be
+ * clipped to the content area already.
robertphillips 2015/11/05 20:13:24 filterConstraint ? Could use a less cryptic explan
bsalomon 2015/11/06 15:24:26 It has a
+ * @param constraintMode Do all texture reads
+ * @param coordsLimitedToConstraintRect Is it known that textureMatrix*localCoords is bound
+ * by the portion of the texture indicated by
+ * constraintRect (without consideration of filter
+ * width, just the raw coords).
robertphillips 2015/11/05 20:13:24 // An in/out param that is ... // On input it ...
bsalomon 2015/11/06 15:24:26 It's not in/out. Made a real comment.
+ * @param filterOrNullForBicubic Exactly what it sounds like.
+ **/
+ const GrFragmentProcessor* createFragmentProcessor(
+ const SkMatrix& textureMatrix,
+ const SkRect& constraintRect,
+ FilterConstraint filterConstraint,
+ bool coordsLimitedToConstraintRect,
+ const GrTextureParams::FilterMode* filterOrNullForBicubic);
+
+ GrTexture* originalTexture() { return fOriginal; }
+
protected:
/** The whole texture is content. */
explicit GrTextureAdjuster(GrTexture* original): fOriginal(original) {}
GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea);
- GrTexture* originalTexture() { return fOriginal; }
-
/** Returns the content area or null for the whole original texture */
const SkIRect* contentArea() { return fContentArea.getMaybeNull(); }

Powered by Google App Engine
This is Rietveld 408576698