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
This commit is contained in:
caryclark 2014-08-25 06:53:04 -07:00 committed by Commit bot
parent 3053dfaefd
commit 2e40381060
4 changed files with 6 additions and 6 deletions

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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