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

Unified Diff: src/gpu/batches/GrDrawAtlasBatch.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 | « src/gpu/batches/GrDefaultPathRenderer.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawAtlasBatch.cpp
diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp
index 58ce137d76307d5d3c6688943eea12afdba0e715..5b823a95a166bd1ffe4aa93d66bf321655d7a013 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.cpp
+++ b/src/gpu/batches/GrDrawAtlasBatch.cpp
@@ -36,7 +36,7 @@ void GrDrawAtlasBatch::initBatchTracker(const GrXPOverridesForBatch& overrides)
fCoverageIgnored = !overrides.readsCoverage();
}
-static const GrGeometryProcessor* set_vertex_attributes(bool hasColors,
+static sk_sp<GrGeometryProcessor> set_vertex_attributes(bool hasColors,
GrColor color,
const SkMatrix& viewMatrix,
bool coverageIgnored) {
@@ -48,15 +48,15 @@ static const GrGeometryProcessor* set_vertex_attributes(bool hasColors,
Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_Type);
LocalCoords localCoords(LocalCoords::kHasExplicit_Type);
- return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewMatrix);
+ return GrDefaultGeoProcFactory::Make(gpColor, coverage, localCoords, viewMatrix);
}
void GrDrawAtlasBatch::onPrepareDraws(Target* target) const {
// Setup geometry processor
- SkAutoTUnref<const GrGeometryProcessor> gp(set_vertex_attributes(this->hasColors(),
- this->color(),
- this->viewMatrix(),
- this->coverageIgnored()));
+ sk_sp<GrGeometryProcessor> gp(set_vertex_attributes(this->hasColors(),
+ this->color(),
+ this->viewMatrix(),
+ this->coverageIgnored()));
int instanceCount = fGeoData.count();
size_t vertexStride = gp->getVertexStride();
@@ -79,7 +79,7 @@ void GrDrawAtlasBatch::onPrepareDraws(Target* target) const {
memcpy(vertPtr, args.fVerts.begin(), allocSize);
vertPtr += allocSize;
}
- helper.recordDraw(target, gp);
+ helper.recordDraw(target, gp.get());
}
GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix,
« no previous file with comments | « src/gpu/batches/GrDefaultPathRenderer.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698