| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrSingleTextureEffect_DEFINED | 8 #ifndef GrSingleTextureEffect_DEFINED |
| 9 #define GrSingleTextureEffect_DEFINED | 9 #define GrSingleTextureEffect_DEFINED |
| 10 | 10 |
| 11 #include "GrFragmentProcessor.h" | 11 #include "GrFragmentProcessor.h" |
| 12 #include "GrCoordTransform.h" | 12 #include "GrCoordTransform.h" |
| 13 #include "GrInvariantOutput.h" | 13 #include "GrInvariantOutput.h" |
| 14 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
| 15 | 15 |
| 16 class GrTexture; | 16 class GrTexture; |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * A base class for effects that draw a single texture with a texture matrix. Th
is effect has no | 19 * A base class for effects that draw a single texture with a texture matrix. Th
is effect has no |
| 20 * backend implementations. One must be provided by the subclass. | 20 * backend implementations. One must be provided by the subclass. |
| 21 */ | 21 */ |
| 22 class GrSingleTextureEffect : public GrFragmentProcessor { | 22 class GrSingleTextureEffect : public GrFragmentProcessor { |
| 23 public: | 23 public: |
| 24 virtual ~GrSingleTextureEffect(); | 24 ~GrSingleTextureEffect() override; |
| 25 |
| 26 SkString dumpInfo() const override { |
| 27 SkString str; |
| 28 str.appendf("Texture: %d", fTextureAccess.getTexture()->getUniqueID()); |
| 29 return str; |
| 30 } |
| 25 | 31 |
| 26 protected: | 32 protected: |
| 27 /** unfiltered, clamp mode */ | 33 /** unfiltered, clamp mode */ |
| 28 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoo
rdSet); | 34 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoo
rdSet); |
| 29 /** clamp mode */ | 35 /** clamp mode */ |
| 30 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMo
de filterMode, | 36 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMo
de filterMode, |
| 31 GrCoordSet = kLocal_GrCoordSet); | 37 GrCoordSet = kLocal_GrCoordSet); |
| 32 GrSingleTextureEffect(GrTexture*, | 38 GrSingleTextureEffect(GrTexture*, |
| 33 const SkMatrix&, | 39 const SkMatrix&, |
| 34 const GrTextureParams&, | 40 const GrTextureParams&, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 50 } | 56 } |
| 51 | 57 |
| 52 private: | 58 private: |
| 53 GrCoordTransform fCoordTransform; | 59 GrCoordTransform fCoordTransform; |
| 54 GrTextureAccess fTextureAccess; | 60 GrTextureAccess fTextureAccess; |
| 55 | 61 |
| 56 typedef GrFragmentProcessor INHERITED; | 62 typedef GrFragmentProcessor INHERITED; |
| 57 }; | 63 }; |
| 58 | 64 |
| 59 #endif | 65 #endif |
| OLD | NEW |