aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
Diffstat (limited to 'gm')
-rw-r--r--gm/bigrrectaaeffect.cpp2
-rw-r--r--gm/constcolorprocessor.cpp2
-rw-r--r--gm/convexpolyeffect.cpp4
-rw-r--r--gm/rrects.cpp2
-rw-r--r--gm/texturedomaineffect.cpp10
-rw-r--r--gm/windowrectangles.cpp16
-rw-r--r--gm/yuvtorgbeffect.cpp9
7 files changed, 22 insertions, 23 deletions
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp
index e60cfdf7b8..da89f45e1f 100644
--- a/gm/bigrrectaaeffect.cpp
+++ b/gm/bigrrectaaeffect.cpp
@@ -77,7 +77,7 @@ protected:
SkRRect rrect = fRRect;
rrect.offset(SkIntToScalar(x + kGap), SkIntToScalar(y + kGap));
- sk_sp<GrFragmentProcessor> fp(GrRRectEffect::Make(edgeType, rrect));
+ std::unique_ptr<GrFragmentProcessor> fp(GrRRectEffect::Make(edgeType, rrect));
SkASSERT(fp);
if (fp) {
GrPaint grPaint;
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index 39926a98eb..6e6ed0dc18 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -106,7 +106,7 @@ protected:
GrConstColorProcessor::InputMode mode = (GrConstColorProcessor::InputMode) m;
GrColor4f color = GrColor4f::FromGrColor(kColors[procColor]);
- sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(color, mode));
+ auto fp = GrConstColorProcessor::Make(color, mode);
grPaint.addColorFragmentProcessor(std::move(fp));
renderTargetContext->priv().testingOnly_addDrawOp(
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 414acaac5b..dcde1045c9 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -191,7 +191,7 @@ protected:
path->transform(m, &p);
GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
- sk_sp<GrFragmentProcessor> fp(GrConvexPolyEffect::Make(edgeType, p));
+ std::unique_ptr<GrFragmentProcessor> fp(GrConvexPolyEffect::Make(edgeType, p));
if (!fp) {
continue;
}
@@ -231,7 +231,7 @@ protected:
SkRect rect = *iter.get();
rect.offset(x, y);
GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
- sk_sp<GrFragmentProcessor> fp(GrConvexPolyEffect::Make(edgeType, rect));
+ std::unique_ptr<GrFragmentProcessor> fp(GrConvexPolyEffect::Make(edgeType, rect));
if (!fp) {
continue;
}
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 3124895a49..399085034a 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -106,7 +106,7 @@ protected:
SkRRect rrect = fRRects[curRRect];
rrect.offset(SkIntToScalar(x), SkIntToScalar(y));
GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
- sk_sp<GrFragmentProcessor> fp(GrRRectEffect::Make(edgeType, rrect));
+ auto fp = GrRRectEffect::Make(edgeType, rrect);
if (fp) {
GrPaint grPaint;
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index 68260dee0f..930e2682c6 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -122,12 +122,10 @@ protected:
GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m;
GrPaint grPaint;
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
- sk_sp<GrFragmentProcessor> fp(
- GrTextureDomainEffect::Make(
- proxy,
- nullptr, textureMatrices[tm],
- GrTextureDomain::MakeTexelDomainForMode(texelDomains[d], mode),
- mode, GrSamplerParams::kNone_FilterMode));
+ auto fp = GrTextureDomainEffect::Make(
+ proxy, nullptr, textureMatrices[tm],
+ GrTextureDomain::MakeTexelDomainForMode(texelDomains[d], mode), mode,
+ GrSamplerParams::kNone_FilterMode);
if (!fp) {
continue;
diff --git a/gm/windowrectangles.cpp b/gm/windowrectangles.cpp
index dc5b93dbe0..f656b23aa0 100644
--- a/gm/windowrectangles.cpp
+++ b/gm/windowrectangles.cpp
@@ -149,18 +149,20 @@ private:
*/
class AlphaOnlyClip final : public MaskOnlyClipBase {
public:
- AlphaOnlyClip(sk_sp<GrTextureProxy> mask, int x, int y) {
- int w = mask->width(), h = mask->height();
- fFP = GrDeviceSpaceTextureDecalFragmentProcessor::Make(std::move(mask),
- SkIRect::MakeWH(w, h), {x, y});
- }
+ AlphaOnlyClip(sk_sp<GrTextureProxy> mask, int x, int y) : fMask(mask), fX(x), fY(y) {}
+
private:
bool apply(GrContext*, GrRenderTargetContext*, bool, bool, GrAppliedClip* out,
SkRect* bounds) const override {
- out->addCoverageFP(fFP);
+ int w = fMask->width();
+ int h = fMask->height();
+ out->addCoverageFP(GrDeviceSpaceTextureDecalFragmentProcessor::Make(
+ fMask, SkIRect::MakeWH(w, h), {fX, fY}));
return true;
}
- sk_sp<GrFragmentProcessor> fFP;
+ sk_sp<GrTextureProxy> fMask;
+ int fX;
+ int fY;
};
/**
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index 5a9ccddb71..001c53d701 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -118,7 +118,7 @@ protected:
{1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
for (int i = 0; i < 6; ++i) {
- sk_sp<GrFragmentProcessor> fp(
+ std::unique_ptr<GrFragmentProcessor> fp(
GrYUVEffect::MakeYUVToRGB(proxy[indices[i][0]],
proxy[indices[i][1]],
proxy[indices[i][2]],
@@ -247,13 +247,12 @@ protected:
GrPaint grPaint;
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
- sk_sp<GrFragmentProcessor> fp(
- GrYUVEffect::MakeYUVToRGB(proxy[0], proxy[1], proxy[2], sizes,
- static_cast<SkYUVColorSpace>(space), true));
+ auto fp = GrYUVEffect::MakeYUVToRGB(proxy[0], proxy[1], proxy[2], sizes,
+ static_cast<SkYUVColorSpace>(space), true);
if (fp) {
SkMatrix viewMatrix;
viewMatrix.setTranslate(x, y);
- grPaint.addColorFragmentProcessor(fp);
+ grPaint.addColorFragmentProcessor(std::move(fp));
renderTargetContext->priv().testingOnly_addDrawOp(GrRectOpFactory::MakeNonAAFill(
std::move(grPaint), viewMatrix, renderRect, GrAAType::kNone));
}