diff options
author | Brian Salomon <bsalomon@google.com> | 2017-07-26 13:11:51 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-26 17:52:00 +0000 |
commit | 1a2a7abe96d258399cca111ea55594599b461c33 (patch) | |
tree | 84e6a556766931cb8df890b8fa03c981fddac42e /src/gpu/effects/GrTextureDomain.cpp | |
parent | df6660f64e4d915de7471c3daa67f9b68037ff3f (diff) |
More GrFragmentProcessor::clone() implementations.
GrSRGBEffect
EllipticalRRectEffect
CircularRRectEffect
GrNonlinearColorSpaceXformEffect
GrDeviceSpaceTextureDecalFragmentProcessor
Change-Id: I701fb7ed36e66414adba2eea73f6eed306691b49
Reviewed-on: https://skia-review.googlesource.com/26942
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrTextureDomain.cpp')
-rw-r--r-- | src/gpu/effects/GrTextureDomain.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index f2b78586d7..17ad223c2c 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -344,6 +344,20 @@ GrDeviceSpaceTextureDecalFragmentProcessor::GrDeviceSpaceTextureDecalFragmentPro this->initClassID<GrDeviceSpaceTextureDecalFragmentProcessor>(); } +GrDeviceSpaceTextureDecalFragmentProcessor::GrDeviceSpaceTextureDecalFragmentProcessor( + const GrDeviceSpaceTextureDecalFragmentProcessor& that) + : INHERITED(kCompatibleWithCoverageAsAlpha_OptimizationFlag) + , fTextureSampler(that.fTextureSampler) + , fTextureDomain(that.fTextureDomain) + , fDeviceSpaceOffset(that.fDeviceSpaceOffset) { + this->initClassID<GrDeviceSpaceTextureDecalFragmentProcessor>(); + this->addTextureSampler(&fTextureSampler); +} + +sk_sp<GrFragmentProcessor> GrDeviceSpaceTextureDecalFragmentProcessor::clone() const { + return sk_sp<GrFragmentProcessor>(new GrDeviceSpaceTextureDecalFragmentProcessor(*this)); +} + GrGLSLFragmentProcessor* GrDeviceSpaceTextureDecalFragmentProcessor::onCreateGLSLInstance() const { class GLSLProcessor : public GrGLSLFragmentProcessor { public: @@ -401,8 +415,8 @@ GrGLSLFragmentProcessor* GrDeviceSpaceTextureDecalFragmentProcessor::onCreateGLS bool GrDeviceSpaceTextureDecalFragmentProcessor::onIsEqual(const GrFragmentProcessor& fp) const { const GrDeviceSpaceTextureDecalFragmentProcessor& dstdfp = fp.cast<GrDeviceSpaceTextureDecalFragmentProcessor>(); - return dstdfp.fTextureSampler.proxy()->underlyingUniqueID() ==
- fTextureSampler.proxy()->underlyingUniqueID() &&
+ return dstdfp.fTextureSampler.proxy()->underlyingUniqueID() == + fTextureSampler.proxy()->underlyingUniqueID() && dstdfp.fDeviceSpaceOffset == fDeviceSpaceOffset && dstdfp.fTextureDomain == fTextureDomain; } |