Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: src/core/SkPaint.cpp

Issue 203203003: SkPaint: eliminate some dead bytes in 64-bit build. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 2449ed6793c241fa55ce5c0dfccc77ec72a34a7a..22f0dada7c93d0189ab06ec989ffc2460b5c5361 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -108,18 +108,30 @@ 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)
+ COPY(fTextSize);
+ COPY(fTextScaleX);
+ COPY(fTextSkewX);
+ COPY(fColor);
+ COPY(fWidth);
+ COPY(fMiterLimit);
+
+ 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(fBitfields);
+ COPY(fDirtyBits);
+#undef COPY
+#undef REF_COPY
#ifdef SK_BUILD_FOR_ANDROID
new (&fPaintOptionsAndroid) SkPaintOptionsAndroid(src.fPaintOptionsAndroid);
« include/core/SkPaint.h ('K') | « include/core/SkPaint.h ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698