diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-19 11:42:34 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-19 11:42:34 +0000 |
commit | fa4dc2c4cba94aec91142a24b4dc26c1dde56023 (patch) | |
tree | 2c069c95748b033349946195c3ddc17e44e67ee1 /src/core | |
parent | 2002d881e80e0d56440ed2fc4da5f90bf2f0e0fb (diff) |
SkPaint: eliminate some dead bytes in 64-bit build.
+ memcpy-based copy constructor was hiding this gap -> manual copy constructor.
+ Split tests for finer-grained failures.
BUG=skia:
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/203203003
git-svn-id: http://skia.googlecode.com/svn/trunk@13856 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPaint.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 2449ed6793..c91ada9a3c 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -108,18 +108,29 @@ SkPaint::SkPaint() { } SkPaint::SkPaint(const SkPaint& src) { - memcpy(this, &src, sizeof(src)); - - SkSafeRef(fTypeface); - SkSafeRef(fPathEffect); - SkSafeRef(fShader); - SkSafeRef(fXfermode); - SkSafeRef(fMaskFilter); - SkSafeRef(fColorFilter); - SkSafeRef(fRasterizer); - SkSafeRef(fLooper); - SkSafeRef(fImageFilter); - SkSafeRef(fAnnotation); +#define COPY(field) field = src.field +#define REF_COPY(field) field = SkSafeRef(src.field) + REF_COPY(fTypeface); + REF_COPY(fPathEffect); + REF_COPY(fShader); + REF_COPY(fXfermode); + REF_COPY(fMaskFilter); + REF_COPY(fColorFilter); + REF_COPY(fRasterizer); + REF_COPY(fLooper); + REF_COPY(fImageFilter); + REF_COPY(fAnnotation); + + COPY(fTextSize); + COPY(fTextScaleX); + COPY(fTextSkewX); + COPY(fColor); + COPY(fWidth); + COPY(fMiterLimit); + COPY(fBitfields); + COPY(fDirtyBits); +#undef COPY +#undef REF_COPY #ifdef SK_BUILD_FOR_ANDROID new (&fPaintOptionsAndroid) SkPaintOptionsAndroid(src.fPaintOptionsAndroid); |