Convert GrBuffer owners to sk_sp
Change-Id: Id49d775c30f01f4de05f385227c5ed5d90d6839e
Reviewed-on: https://skia-review.googlesource.com/c/187920
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index 3648514..fc8bca8 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -158,7 +158,7 @@
for (int y = 0; y < kBoxCountY; ++y) {
GrMesh mesh(GrPrimitiveType::kTriangles);
mesh.setNonIndexedNonInstanced(kBoxCountX * 6);
- mesh.setVertexData(vbuff.get(), y * kBoxCountX * 6);
+ mesh.setVertexData(vbuff, y * kBoxCountX * 6);
helper->drawMesh(mesh);
}
});
@@ -177,10 +177,9 @@
int repetitionCount = SkTMin(3 - baseRepetition, kBoxCount - i);
GrMesh mesh(GrPrimitiveType::kTriangles);
- mesh.setIndexed(ibuff.get(), repetitionCount * 6, baseRepetition * 6,
- baseRepetition * 4, (baseRepetition + repetitionCount) * 4 - 1,
- GrPrimitiveRestart::kNo);
- mesh.setVertexData(vbuff.get(), (i - baseRepetition) * 4);
+ mesh.setIndexed(ibuff, repetitionCount * 6, baseRepetition * 6, baseRepetition * 4,
+ (baseRepetition + repetitionCount) * 4 - 1, GrPrimitiveRestart::kNo);
+ mesh.setVertexData(vbuff, (i - baseRepetition) * 4);
helper->drawMesh(mesh);
baseRepetition = (baseRepetition + 1) % 3;
@@ -198,8 +197,8 @@
// support a base index.
for (int y = 0; y < kBoxCountY; ++y) {
GrMesh mesh(GrPrimitiveType::kTriangles);
- mesh.setIndexedPatterned(ibuff.get(), 6, 4, kBoxCountX, kIndexPatternRepeatCount);
- mesh.setVertexData(vbuff.get(), y * kBoxCountX * 4);
+ mesh.setIndexedPatterned(ibuff, 6, 4, kBoxCountX, kIndexPatternRepeatCount);
+ mesh.setVertexData(vbuff, y * kBoxCountX * 4);
helper->drawMesh(mesh);
}
});
@@ -227,10 +226,10 @@
: GrPrimitiveType::kTriangleStrip);
if (indexed) {
VALIDATE(idxbuff);
- mesh.setIndexedInstanced(idxbuff.get(), 6, instbuff.get(), kBoxCountX,
- y * kBoxCountX, GrPrimitiveRestart::kNo);
+ mesh.setIndexedInstanced(idxbuff, 6, instbuff, kBoxCountX, y * kBoxCountX,
+ GrPrimitiveRestart::kNo);
} else {
- mesh.setInstanced(instbuff.get(), kBoxCountX, y * kBoxCountX, 4);
+ mesh.setInstanced(instbuff, kBoxCountX, y * kBoxCountX, 4);
}
switch (y % 3) {
case 0:
@@ -243,10 +242,10 @@
}
// Fallthru.
case 1:
- mesh.setVertexData(vbuff.get());
+ mesh.setVertexData(vbuff);
break;
case 2:
- mesh.setVertexData(vbuff2.get(), 2);
+ mesh.setVertexData(vbuff2, 2);
break;
}
helper->drawMesh(mesh);