aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2014-08-25 06:53:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-25 06:53:04 -0700
commit2e40381060794745562c4a26896970406114b07a (patch)
tree00b3ddca672fa16e35eee88e67157ce266dfc4b6
parent3053dfaefd12abd220d961e7e4c661e6eb8ba90e (diff)
add const to arrays of member functions
running 'size ./out/Release/libskia_core.a' revealed a couple of places where path ops chose poorly and declared arrays of member functions to be unnecessarily writable. R=reed@android.com TBR=reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/461363003
-rw-r--r--src/pathops/SkIntersections.cpp4
-rw-r--r--src/pathops/SkIntersections.h4
-rw-r--r--src/pathops/SkPathOpsBounds.cpp2
-rw-r--r--src/pathops/SkPathOpsBounds.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/pathops/SkIntersections.cpp b/src/pathops/SkIntersections.cpp
index 56eba2717b..62c1e411ad 100644
--- a/src/pathops/SkIntersections.cpp
+++ b/src/pathops/SkIntersections.cpp
@@ -13,14 +13,14 @@ void SkIntersections::append(const SkIntersections& i) {
}
}
-int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkScalar, bool) = {
+int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkScalar, bool) = {
NULL,
&SkIntersections::verticalLine,
&SkIntersections::verticalQuad,
&SkIntersections::verticalCubic
};
-int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine&) = {
+int ( SkIntersections::* const CurveRay[])(const SkPoint[], const SkDLine&) = {
NULL,
&SkIntersections::lineRay,
&SkIntersections::quadRay,
diff --git a/src/pathops/SkIntersections.h b/src/pathops/SkIntersections.h
index 0186b3797d..040671093c 100644
--- a/src/pathops/SkIntersections.h
+++ b/src/pathops/SkIntersections.h
@@ -287,8 +287,8 @@ private:
#endif
};
-extern int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine& );
-extern int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar top, SkScalar bottom,
+extern int (SkIntersections::* const CurveRay[])(const SkPoint[], const SkDLine& );
+extern int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar top, SkScalar bottom,
SkScalar x, bool flipped);
#endif
diff --git a/src/pathops/SkPathOpsBounds.cpp b/src/pathops/SkPathOpsBounds.cpp
index 106cd30076..e5b26eec25 100644
--- a/src/pathops/SkPathOpsBounds.cpp
+++ b/src/pathops/SkPathOpsBounds.cpp
@@ -32,7 +32,7 @@ void SkPathOpsBounds::setQuadBounds(const SkPoint a[3]) {
SkDoubleToScalar(dRect.fRight), SkDoubleToScalar(dRect.fBottom));
}
-void (SkPathOpsBounds::*SetCurveBounds[])(const SkPoint[]) = {
+void (SkPathOpsBounds::* const SetCurveBounds[])(const SkPoint[]) = {
NULL,
&SkPathOpsBounds::setLineBounds,
&SkPathOpsBounds::setQuadBounds,
diff --git a/src/pathops/SkPathOpsBounds.h b/src/pathops/SkPathOpsBounds.h
index 07ad5d4ba9..cabc639225 100644
--- a/src/pathops/SkPathOpsBounds.h
+++ b/src/pathops/SkPathOpsBounds.h
@@ -67,6 +67,6 @@ struct SkPathOpsBounds : public SkRect {
typedef SkRect INHERITED;
};
-extern void (SkPathOpsBounds::*SetCurveBounds[])(const SkPoint[]);
+extern void (SkPathOpsBounds::* const SetCurveBounds[])(const SkPoint[]);
#endif