Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3522)

Unified Diff: src/gpu/effects/GrSingleTextureEffect.h

Issue 6817079: Make all remaining effects use GrGLEffectMatrix (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/Gr1DKernelEffect.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrSingleTextureEffect.h
===================================================================
--- src/gpu/effects/GrSingleTextureEffect.h (revision 6266)
+++ src/gpu/effects/GrSingleTextureEffect.h (working copy)
@@ -10,16 +10,18 @@
#include "GrEffect.h"
#include "SkMatrix.h"
+#include "GrTexture.h"
class GrGLSingleTextureEffect;
/**
- * An effect that merely blits a single texture; commonly used as a base class.
+ * An effect that draws a single texture with a texture matrix; commonly used as a base class. The
+ * output color is the texture color is modulated against the input color.
*/
class GrSingleTextureEffect : public GrEffect {
public:
- /** These three constructors assume an identity matrix */
+ /** These three constructors assume an identity matrix. TODO: Remove these.*/
GrSingleTextureEffect(GrTexture* texture); /* unfiltered, clamp mode */
GrSingleTextureEffect(GrTexture* texture, bool bilerp); /* clamp mode */
GrSingleTextureEffect(GrTexture* texture, const GrTextureParams&);
@@ -45,6 +47,14 @@
const GrSingleTextureEffect& ste = static_cast<const GrSingleTextureEffect&>(effect);
return INHERITED::isEqual(effect) && fMatrix.cheapEqualTo(ste.getMatrix());
}
+
+ static inline SkMatrix MakeDivByTextureWHMatrix(const GrTexture* texture) {
+ GrAssert(NULL != texture);
+ SkMatrix mat;
+ mat.setIDiv(texture->width(), texture->height());
+ return mat;
+ }
+
private:
GR_DECLARE_EFFECT_TEST;
« no previous file with comments | « src/gpu/effects/Gr1DKernelEffect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b