aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-04 18:34:30 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-04 18:34:30 +0000
commit34cccde630fc618649b9737bee464203d042bfbb (patch)
treeeab2cbb6ebc20e68af3bcfe628fc37aa21e59d7a /include/gpu
parent6eb549e8ca3d88d7536859fd5aa3343fc3011f2f (diff)
Allow GrEffects with multiple textures.
It will work as long as the total number of textures sis less than GrDrawState::kNumStages. That will be fixed in a follow up CL. Review URL: https://codereview.appspot.com/7040052 git-svn-id: http://skia.googlecode.com/svn/trunk@7023 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrEffect.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index 0adc00be00..5a151190a2 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -11,11 +11,11 @@
#include "GrRefCnt.h"
#include "GrNoncopyable.h"
#include "GrEffectUnitTest.h"
+#include "GrTexture.h"
#include "GrTextureAccess.h"
class GrBackendEffectFactory;
class GrContext;
-class GrTexture;
class SkString;
/** Provides custom vertex shader, fragment shader, uniform data for a
@@ -86,6 +86,15 @@ public:
/** Shortcut for textureAccess(index).texture(); */
GrTexture* texture(int index) const { return this->textureAccess(index).getTexture(); }
+ /** Useful for effects that want to insert a texture matrix that is implied by the texture
+ dimensions */
+ static inline SkMatrix MakeDivByTextureWHMatrix(const GrTexture* texture) {
+ GrAssert(NULL != texture);
+ SkMatrix mat;
+ mat.setIDiv(texture->width(), texture->height());
+ return mat;
+ }
+
void* operator new(size_t size);
void operator delete(void* target);