aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrOvalOpFactory.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-05-03 14:36:54 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-03 19:08:40 +0000
commitff926502069d0ddafaecc18dc08973762e4befd2 (patch)
tree5c8c4335c6a3b71006ce2e3646987930ecb2e28e /src/gpu/ops/GrOvalOpFactory.cpp
parent85591831b2fc0f67968116d73c79ee1232a59935 (diff)
Convert GrMesh to a struct
Converts GrMesh to a struct and changes the names/semantics of its fields to be more inline with their GL counterparts. Also renames the "instancing" feature to "pattern", to avoid ambiguity with hardware instancing. Bug: skia: Change-Id: Ia0999d4f9c83b5dd31f81b9bf4f36ed9abd26286 Reviewed-on: https://skia-review.googlesource.com/15157 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops/GrOvalOpFactory.cpp')
-rw-r--r--src/gpu/ops/GrOvalOpFactory.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 71f8bb089f..4d44b13949 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -1097,8 +1097,13 @@ private:
}
GrMesh mesh;
- mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
- firstIndex, fVertCount, fIndexCount);
+ mesh.fPrimitiveType = kTriangles_GrPrimitiveType;
+ mesh.fIndexBuffer.reset(indexBuffer);
+ mesh.fIndexCount = fIndexCount;
+ mesh.fBaseIndex = firstIndex;
+ mesh.fVertexBuffer.reset(vertexBuffer);
+ mesh.fVertexCount = fVertCount;
+ mesh.fBaseVertex = firstVertex;
target->draw(gp.get(), this->pipeline(), mesh);
}
@@ -1998,8 +2003,13 @@ private:
}
GrMesh mesh;
- mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
- firstIndex, fVertCount, fIndexCount);
+ mesh.fPrimitiveType = kTriangles_GrPrimitiveType;
+ mesh.fIndexBuffer.reset(indexBuffer);
+ mesh.fIndexCount = fIndexCount;
+ mesh.fBaseIndex = firstIndex;
+ mesh.fVertexBuffer.reset(vertexBuffer);
+ mesh.fVertexCount = fVertCount;
+ mesh.fBaseVertex = firstVertex;
target->draw(gp.get(), this->pipeline(), mesh);
}
@@ -2055,11 +2065,11 @@ static const GrBuffer* ref_rrect_index_buffer(RRectType type,
GR_DEFINE_STATIC_UNIQUE_KEY(gRRectOnlyIndexBufferKey);
switch (type) {
case kFill_RRectType:
- return resourceProvider->findOrCreateInstancedIndexBuffer(
+ return resourceProvider->findOrCreatePatternedIndexBuffer(
gStandardRRectIndices, kIndicesPerFillRRect, kNumRRectsInIndexBuffer,
kVertsPerStandardRRect, gRRectOnlyIndexBufferKey);
case kStroke_RRectType:
- return resourceProvider->findOrCreateInstancedIndexBuffer(
+ return resourceProvider->findOrCreatePatternedIndexBuffer(
gStandardRRectIndices, kIndicesPerStrokeRRect, kNumRRectsInIndexBuffer,
kVertsPerStandardRRect, gStrokeRRectOnlyIndexBufferKey);
default:
@@ -2185,7 +2195,7 @@ private:
sk_sp<const GrBuffer> indexBuffer(ref_rrect_index_buffer(
fStroked ? kStroke_RRectType : kFill_RRectType, target->resourceProvider()));
- InstancedHelper helper;
+ PatternHelper helper;
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(
helper.init(target, kTriangles_GrPrimitiveType, vertexStride, indexBuffer.get(),
kVertsPerStandardRRect, indicesPerInstance, instanceCount));