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

Unified Diff: include/gpu/GrCoordTransform.h

Issue 787873002: Use threshold of 1 texture coord value per pixel w/ nearest neighbor. (Closed) Base URL: https://skia.googlesource.com/skia.git@matrix_prec
Patch Set: update comments Created 6 years 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/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrCoordTransform.h
diff --git a/include/gpu/GrCoordTransform.h b/include/gpu/GrCoordTransform.h
index 775089cab8bded5f6e7fc27d23c9fb733ec15328..e97de0d8a8e415501cbc47c5a38d80d8aa724e05 100644
--- a/include/gpu/GrCoordTransform.h
+++ b/include/gpu/GrCoordTransform.h
@@ -48,24 +48,26 @@ public:
/**
* Create a transformation that maps [0, 1] to a texture's boundaries. The precision is inferred
- * from the texture size.
+ * from the texture size and filter. The texture origin also implies whether a y-reversal should
+ * be performed.
*/
- GrCoordTransform(GrCoordSet sourceCoords, const GrTexture* texture) {
+ GrCoordTransform(GrCoordSet sourceCoords,
+ const GrTexture* texture,
+ GrTextureParams::FilterMode filter) {
SkASSERT(texture);
SkDEBUGCODE(fInProcessor = false);
- this->reset(sourceCoords, texture);
+ this->reset(sourceCoords, texture, filter);
}
/**
- * Create a transformation from a matrix. The texture parameter is used to infer if the
- * framework should internally do a y reversal to account for it being upside down by Skia's
- * coord convention and the precision of the shader variables used to implement the coord
- * transform.
+ * Create a transformation from a matrix. The precision is inferred from the texture size and
+ * filter. The texture origin also implies whether a y-reversal should be performed.
*/
- GrCoordTransform(GrCoordSet sourceCoords, const SkMatrix& m, const GrTexture* texture) {
+ GrCoordTransform(GrCoordSet sourceCoords, const SkMatrix& m,
+ const GrTexture* texture, GrTextureParams::FilterMode filter) {
SkDEBUGCODE(fInProcessor = false);
SkASSERT(texture);
- this->reset(sourceCoords, m, texture);
+ this->reset(sourceCoords, m, texture, filter);
}
/**
@@ -77,13 +79,14 @@ public:
this->reset(sourceCoords, m, precision);
}
- void reset(GrCoordSet sourceCoords, const GrTexture* texture) {
+ void reset(GrCoordSet sourceCoords, const GrTexture* texture,
+ GrTextureParams::FilterMode filter) {
SkASSERT(!fInProcessor);
SkASSERT(texture);
- this->reset(sourceCoords, MakeDivByTextureWHMatrix(texture), texture);
+ this->reset(sourceCoords, MakeDivByTextureWHMatrix(texture), texture, filter);
}
- void reset(GrCoordSet, const SkMatrix&, const GrTexture*);
+ void reset(GrCoordSet, const SkMatrix&, const GrTexture*, GrTextureParams::FilterMode filter);
void reset(GrCoordSet sourceCoords, const SkMatrix& m,
GrSLPrecision precision = kDefault_GrSLPrecision);
« no previous file with comments | « no previous file | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698