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:
parent
3053dfaefd
commit
2e40381060
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user