aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-07-25 14:59:03 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-25 19:25:41 +0000
commitffc2ec46da40776c0b8056bbbaa2f43e92b46729 (patch)
treef0cb82d197b0470acc534adedb1afa8f3ef702dd /src/gpu
parent816afd83f45ac72b6b3b9ffe418b4baef8ecbc42 (diff)
Implement clone() for GrDisplacementEffect
This also adds copy constructors for: GrTextureDomain GrFragmentProcessor::TextureSampler GrCoordTransform Change-Id: I23cb85113e236f8b6fd1d91163c80d2a41931691 Reviewed-on: https://skia-review.googlesource.com/26621 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrCoordTransform.h5
-rw-r--r--src/gpu/GrProcessor.h13
-rw-r--r--src/gpu/effects/GrTextureDomain.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/src/gpu/GrCoordTransform.h b/src/gpu/GrCoordTransform.h
index 5bccf5c6d8..5d3faa3047 100644
--- a/src/gpu/GrCoordTransform.h
+++ b/src/gpu/GrCoordTransform.h
@@ -18,7 +18,7 @@ class GrTexture;
* A class representing a linear transformation of local coordinates. GrFragnentProcessors
* these transformations, and the GrGeometryProcessor implements the transformation.
*/
-class GrCoordTransform : SkNoncopyable {
+class GrCoordTransform {
public:
GrCoordTransform()
: fProxy(nullptr)
@@ -27,6 +27,8 @@ public:
SkDEBUGCODE(fInProcessor = false);
}
+ GrCoordTransform(const GrCoordTransform&) = default;
+
/**
* Create a transformation that maps [0, 1] to a proxy's boundaries. The proxy origin also
* implies whether a y-reversal should be performed.
@@ -129,7 +131,6 @@ private:
const GrTextureProxy* fProxy;
bool fNormalize;
bool fReverseY;
- typedef SkNoncopyable INHERITED;
#ifdef SK_DEBUG
public:
diff --git a/src/gpu/GrProcessor.h b/src/gpu/GrProcessor.h
index a2be518de6..2afebb72b1 100644
--- a/src/gpu/GrProcessor.h
+++ b/src/gpu/GrProcessor.h
@@ -212,12 +212,21 @@ private:
* along with an associated GrSamplerParams. TextureSamplers don't perform any coord manipulation to
* account for texture origin.
*/
-class GrResourceIOProcessor::TextureSampler : public SkNoncopyable {
+class GrResourceIOProcessor::TextureSampler {
public:
/**
* Must be initialized before adding to a GrProcessor's texture access list.
*/
TextureSampler();
+ /**
+ * This copy constructor is used by GrFragmentProcessor::clone() implementations. The copy
+ * always takes a new ref on the texture proxy as the new fragment processor will not yet be
+ * in pending execution state.
+ */
+ explicit TextureSampler(const TextureSampler& that)
+ : fProxyRef(sk_ref_sp(that.fProxyRef.get()), that.fProxyRef.ioType())
+ , fParams(that.fParams)
+ , fVisibility(that.fVisibility) {}
TextureSampler(sk_sp<GrTextureProxy>, const GrSamplerParams&);
explicit TextureSampler(sk_sp<GrTextureProxy>,
@@ -264,8 +273,6 @@ private:
GrSurfaceProxyRef fProxyRef;
GrSamplerParams fParams;
GrShaderFlags fVisibility;
-
- typedef SkNoncopyable INHERITED;
};
/**
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 8be1a2bc66..f6970ea46e 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -55,6 +55,8 @@ public:
*/
GrTextureDomain(GrTextureProxy*, const SkRect& domain, Mode, int index = -1);
+ GrTextureDomain(const GrTextureDomain&) = default;
+
const SkRect& domain() const { return fDomain; }
Mode mode() const { return fMode; }