| 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 "GrColorSpaceXform.h" | 12 #include "GrColorSpaceXform.h" |
| 13 #include "GrCoordTransform.h" | 13 #include "GrCoordTransform.h" |
| 14 #include "GrInvariantOutput.h" | 14 #include "GrInvariantOutput.h" |
| 15 #include "SkMatrix.h" | 15 #include "SkMatrix.h" |
| 16 | 16 |
| 17 class GrTexture; | 17 class GrTexture; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * A base class for effects that draw a single texture with a texture matrix. Th
is effect has no | 20 * A base class for effects that draw a single texture with a texture matrix. Th
is effect has no |
| 21 * backend implementations. One must be provided by the subclass. | 21 * backend implementations. One must be provided by the subclass. |
| 22 */ | 22 */ |
| 23 class GrSingleTextureEffect : public GrFragmentProcessor { | 23 class GrSingleTextureEffect : public GrFragmentProcessor { |
| 24 public: | 24 public: |
| 25 ~GrSingleTextureEffect() override; | 25 ~GrSingleTextureEffect() override; |
| 26 | 26 |
| 27 SkString dumpInfo() const override { | 27 SkString dumpInfo() const override { |
| 28 SkString str; | 28 SkString str; |
| 29 str.appendf("Texture: %d", fTextureAccess.getTexture()->getUniqueID()); | 29 str.appendf("Texture: %d", fTextureAccess.getTexture()->uniqueID()); |
| 30 return str; | 30 return str; |
| 31 } | 31 } |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 /** unfiltered, clamp mode */ | 34 /** unfiltered, clamp mode */ |
| 35 GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&, | 35 GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&, |
| 36 GrCoordSet = kLocal_GrCoordSet); | 36 GrCoordSet = kLocal_GrCoordSet); |
| 37 /** clamp mode */ | 37 /** clamp mode */ |
| 38 GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&, | 38 GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&, |
| 39 GrTextureParams::FilterMode filterMode, GrCoordSet = k
Local_GrCoordSet); | 39 GrTextureParams::FilterMode filterMode, GrCoordSet = k
Local_GrCoordSet); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 GrCoordTransform fCoordTransform; | 62 GrCoordTransform fCoordTransform; |
| 63 GrTextureAccess fTextureAccess; | 63 GrTextureAccess fTextureAccess; |
| 64 sk_sp<GrColorSpaceXform> fColorSpaceXform; | 64 sk_sp<GrColorSpaceXform> fColorSpaceXform; |
| 65 | 65 |
| 66 typedef GrFragmentProcessor INHERITED; | 66 typedef GrFragmentProcessor INHERITED; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 #endif | 69 #endif |
| OLD | NEW |