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

Unified Diff: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp

Issue 1483103003: Make onPrepareDraws const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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
Index: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index 659f9d4adf62599cea8cd8c0cc3a901a7fa562d5..c0cd0a6d5c8d2e7c76de88913abc0b01a4b4c669 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -161,7 +161,7 @@ private:
}
void draw(GrVertexBatch::Target* target, const GrPipeline* pipeline, int vertexCount,
- size_t vertexStride, void* vertices, int indexCount, uint16_t* indices) {
+ size_t vertexStride, void* vertices, int indexCount, uint16_t* indices) const {
if (vertexCount == 0 || indexCount == 0) {
return;
}
@@ -189,7 +189,7 @@ private:
target->draw(info);
}
- void onPrepareDraws(Target* target) override {
+ void onPrepareDraws(Target* target) const override {
bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage();
// Setup GrGeometryProcessor
@@ -219,7 +219,7 @@ private:
uint8_t* vertices = (uint8_t*) sk_malloc_throw(maxVertices * vertexStride);
uint16_t* indices = (uint16_t*) sk_malloc_throw(maxIndices * sizeof(uint16_t));
for (int i = 0; i < instanceCount; i++) {
- Geometry& args = fGeoData[i];
+ const Geometry& args = fGeoData[i];
GrAAConvexTessellator tess(args.fStrokeWidth, args.fJoin, args.fMiterLimit);
if (!tess.tessellate(args.fViewMatrix, args.fPath)) {
@@ -231,8 +231,8 @@ private:
if (indexCount + currentIndices > UINT16_MAX) {
// if we added the current instance, we would overflow the indices we can store in a
// uint16_t. Draw what we've got so far and reset.
- draw(target, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
- indices);
+ this->draw(target, this->pipeline(), vertexCount, vertexStride, vertices,
+ indexCount, indices);
vertexCount = 0;
indexCount = 0;
}
@@ -251,8 +251,8 @@ private:
vertexCount += currentVertices;
indexCount += currentIndices;
}
- draw(target, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
- indices);
+ this->draw(target, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
+ indices);
sk_free(vertices);
sk_free(indices);
}

Powered by Google App Engine
This is Rietveld 408576698