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

Unified Diff: src/gpu/batches/GrNonAAStrokeRectBatch.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/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;

Powered by Google App Engine
This is Rietveld 408576698