Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: gm/convexpolyeffect.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/dcshader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/convexpolyeffect.cpp
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 13659476bad22e2f2cc5ae62a49097a446f43a14..3f8ae09a1afeceb0e29bceffc6e7bef4b286ed09 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -58,8 +58,8 @@ private:
Color color(this->color());
Coverage coverage(Coverage::kSolid_Type);
LocalCoords localCoords(LocalCoords::kUnused_Type);
- SkAutoTUnref<const GrGeometryProcessor> gp(
- GrDefaultGeoProcFactory::Create(color, coverage, localCoords, SkMatrix::I()));
+ sk_sp<GrGeometryProcessor> gp(
+ GrDefaultGeoProcFactory::Make(color, coverage, localCoords, SkMatrix::I()));
size_t vertexStride = gp->getVertexStride();
SkASSERT(vertexStride == sizeof(SkPoint));
@@ -71,7 +71,7 @@ private:
fRect.toQuad(verts);
- helper.recordDraw(target, gp);
+ helper.recordDraw(target, gp.get());
}
SkRect fRect;
@@ -173,15 +173,14 @@ protected:
path->transform(m, &p);
GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
- SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(edgeType, p));
+ sk_sp<GrFragmentProcessor> fp(GrConvexPolyEffect::Make(edgeType, p));
if (!fp) {
continue;
}
GrPipelineBuilder pipelineBuilder;
- pipelineBuilder.setXPFactory(
- GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref();
- pipelineBuilder.addCoverageFragmentProcessor(fp);
+ pipelineBuilder.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode));
+ pipelineBuilder.addCoverageFragmentProcessor(std::move(fp));
SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(p.getBounds(), 0xff000000));
@@ -213,15 +212,14 @@ protected:
SkRect rect = *iter.get();
rect.offset(x, y);
GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
- SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(edgeType, rect));
+ sk_sp<GrFragmentProcessor> fp(GrConvexPolyEffect::Make(edgeType, rect));
if (!fp) {
continue;
}
GrPipelineBuilder pipelineBuilder;
- pipelineBuilder.setXPFactory(
- GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref();
- pipelineBuilder.addCoverageFragmentProcessor(fp);
+ pipelineBuilder.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode));
+ pipelineBuilder.addCoverageFragmentProcessor(std::move(fp));
SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(rect, 0xff000000));
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/dcshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698