OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2013 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef GrCustomCoordsTextureEffect_DEFINED |
| 9 #define GrCustomCoordsTextureEffect_DEFINED |
| 10 |
| 11 #include "GrEffect.h" |
| 12 |
| 13 class GrGLCustomCoordsTextureEffect; |
| 14 |
| 15 /** |
| 16 * The output color of this effect is a modulation of the input color and a samp
le from a texture. |
| 17 * It allows explicit specification of the filtering and wrap modes (GrTexturePa
rams). The input |
| 18 * coords are a custom attribute. |
| 19 */ |
| 20 class GrCustomCoordsTextureEffect : public GrEffect { |
| 21 public: |
| 22 static GrEffectRef* Create(GrTexture* tex, const GrTextureParams& p) { |
| 23 AutoEffectUnref effect(SkNEW_ARGS(GrCustomCoordsTextureEffect, (tex, p))
); |
| 24 return CreateEffectRef(effect); |
| 25 } |
| 26 |
| 27 virtual ~GrCustomCoordsTextureEffect() {} |
| 28 |
| 29 static const char* Name() { return "Texture"; } |
| 30 |
| 31 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const SK_OVERRIDE; |
| 32 |
| 33 typedef GrGLCustomCoordsTextureEffect GLEffect; |
| 34 |
| 35 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
| 36 |
| 37 private: |
| 38 GrCustomCoordsTextureEffect(GrTexture* texture, const GrTextureParams& param
s); |
| 39 |
| 40 virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE; |
| 41 |
| 42 GrTextureAccess fTextureAccess; |
| 43 |
| 44 GR_DECLARE_EFFECT_TEST; |
| 45 |
| 46 typedef GrEffect INHERITED; |
| 47 }; |
| 48 |
| 49 #endif |
OLD | NEW |