bzero SkPaint in its constructor, to allow us to cleanly use memcmp in our
operator==, given that we may be padded and not know how to init those pad bytes git-svn-id: http://skia.googlecode.com/svn/trunk@321 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
07d1f008b3
commit
a3122b9b1e
@ -33,13 +33,15 @@
|
||||
|
||||
#define SK_DefaultFlags 0 //(kNativeHintsText_Flag)
|
||||
|
||||
SkPaint::SkPaint()
|
||||
{
|
||||
fTypeface = NULL;
|
||||
fTextSize = SK_DefaultTextSize;
|
||||
fTextScaleX = SK_Scalar1;
|
||||
fTextSkewX = 0;
|
||||
SkPaint::SkPaint() {
|
||||
// since we may have padding, we zero everything so that our memcmp() call
|
||||
// in operator== will work correctly.
|
||||
// with this, we can skip 0 and null individual initializations
|
||||
sk_bzero(this, sizeof(*this));
|
||||
|
||||
#if 0 // not needed with the bzero call above
|
||||
fTypeface = NULL;
|
||||
fTextSkewX = 0;
|
||||
fPathEffect = NULL;
|
||||
fShader = NULL;
|
||||
fXfermode = NULL;
|
||||
@ -47,9 +49,12 @@ SkPaint::SkPaint()
|
||||
fColorFilter = NULL;
|
||||
fRasterizer = NULL;
|
||||
fLooper = NULL;
|
||||
|
||||
fColor = SK_ColorBLACK;
|
||||
fWidth = 0;
|
||||
#endif
|
||||
|
||||
fTextSize = SK_DefaultTextSize;
|
||||
fTextScaleX = SK_Scalar1;
|
||||
fColor = SK_ColorBLACK;
|
||||
fMiterLimit = SK_DefaultMiterLimit;
|
||||
fFlags = SK_DefaultFlags;
|
||||
fCapType = kDefault_Cap;
|
||||
|
Loading…
Reference in New Issue
Block a user