aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrSimpleTextureEffect.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-07-31 11:18:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-31 15:44:32 +0000
commitf57c0d67611186ba74179b53b421e64b63a579c7 (patch)
tree6e9cdae25bdc158bcd1a0b667bc95bb8185182f8 /src/gpu/effects/GrSimpleTextureEffect.cpp
parent45b0f15688c1c508204143a3239e0691abd14032 (diff)
automatically generate clone() methods for SkSL fragment processors
Bug: skia: Change-Id: Ib7b90f20d2b1558aad14f38f95c7c884e654c96d Reviewed-on: https://skia-review.googlesource.com/28620 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrSimpleTextureEffect.cpp')
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index bbac5b5f4c..bd2b80529a 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -70,6 +70,19 @@ bool GrSimpleTextureEffect::onIsEqual(const GrFragmentProcessor& other) const {
if (fMatrix != that.fMatrix) return false;
return true;
}
+GrSimpleTextureEffect::GrSimpleTextureEffect(const GrSimpleTextureEffect& src)
+ : INHERITED(src.optimizationFlags())
+ , fImage(src.fImage)
+ , fColorXform(src.fColorXform)
+ , fMatrix(src.fMatrix)
+ , fImageCoordTransform(src.fImageCoordTransform) {
+ this->initClassID<GrSimpleTextureEffect>();
+ this->addTextureSampler(&fImage);
+ this->addCoordTransform(&fImageCoordTransform);
+}
+sk_sp<GrFragmentProcessor> GrSimpleTextureEffect::clone() const {
+ return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(*this));
+}
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSimpleTextureEffect);
#if GR_TEST_UTILS
sk_sp<GrFragmentProcessor> GrSimpleTextureEffect::TestCreate(GrProcessorTestData* testData) {