Chromium Code Reviews| Index: src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
| diff --git a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
| index a5de607c8192223848eda55ad672038b30a46ebc..c8590e5736b416ffa1ffce066172412459415627 100644 |
| --- a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
| +++ b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
| @@ -102,7 +102,7 @@ private: |
| } |
| } |
| - void onPrepareDraws(Target* target) override { |
| + void onPrepareDraws(Target* target) const override { |
| SkAutoTUnref<const GrGeometryProcessor> gp; |
| { |
| using namespace GrDefaultGeoProcFactory; |
| @@ -121,7 +121,7 @@ private: |
| SkASSERT(vertexStride == sizeof(GrDefaultGeoProcFactory::PositionAttr)); |
| - Geometry& args = fGeoData[0]; |
| + const Geometry& args = fGeoData[0]; |
| int vertexCount = kVertsPerHairlineRect; |
| if (args.fStrokeWidth > 0) { |
| @@ -143,10 +143,11 @@ private: |
| GrPrimitiveType primType; |
|
robertphillips
2015/11/30 19:52:40
Just do this copy in the if clause ?
What about do
|
| + SkRect rect = args.fRect; |
| if (args.fStrokeWidth > 0) {; |
| primType = kTriangleStrip_GrPrimitiveType; |
| - args.fRect.sort(); |
| - init_stroke_rect_strip(vertex, args.fRect, args.fStrokeWidth); |
| + rect.sort(); |
| + init_stroke_rect_strip(vertex, rect, args.fStrokeWidth); |
| } else { |
| // hairline |
| primType = kLineStrip_GrPrimitiveType; |