minor reordering of fields to save space
must smaller things at the end
mark const what can be const
removed some =default constructors (to fix warnings)
This CL removes 24 bytes on a 64bit build
Change-Id: I6fb8fba6146b0293755b8f2d743a730159f5b04d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295087
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
diff --git a/modules/skparagraph/src/Run.cpp b/modules/skparagraph/src/Run.cpp
index 3a41877..28c4017 100644
--- a/modules/skparagraph/src/Run.cpp
+++ b/modules/skparagraph/src/Run.cpp
@@ -20,12 +20,13 @@
SkScalar lineHeight,
size_t index,
SkScalar offsetX)
- : fMaster(master)
- , fTextRange(firstChar + info.utf8Range.begin(), firstChar + info.utf8Range.end())
- , fClusterRange(EMPTY_CLUSTERS)
- , fClusterStart(firstChar) {
- fFont = info.fFont;
- fHeightMultiplier = lineHeight;
+ : fMaster(master)
+ , fTextRange(firstChar + info.utf8Range.begin(), firstChar + info.utf8Range.end())
+ , fClusterRange(EMPTY_CLUSTERS)
+ , fFont(info.fFont)
+ , fClusterStart(firstChar)
+ , fHeightMultiplier(lineHeight)
+{
fBidiLevel = info.fBidiLevel;
fAdvance = info.fAdvance;
fIndex = index;
diff --git a/modules/skparagraph/src/Run.h b/modules/skparagraph/src/Run.h
index f356ffe..1d50a36 100644
--- a/modules/skparagraph/src/Run.h
+++ b/modules/skparagraph/src/Run.h
@@ -57,7 +57,6 @@
class Run {
public:
- Run() = default;
Run(ParagraphImpl* master,
const SkShaper::RunHandler::RunInfo& info,
size_t firstChar,
@@ -65,9 +64,7 @@
size_t index,
SkScalar shiftX);
Run(const Run&) = default;
- Run& operator=(const Run&) = default;
Run(Run&&) = default;
- Run& operator=(Run&&) = default;
~Run() = default;
void setMaster(ParagraphImpl* master) { fMaster = master; }
@@ -211,12 +208,8 @@
ClusterRange fClusterRange;
SkFont fFont;
- SkFontMetrics fFontMetrics;
- SkScalar fHeightMultiplier;
size_t fPlaceholderIndex;
- bool fEllipsis;
size_t fIndex;
- uint8_t fBidiLevel;
SkVector fAdvance;
SkVector fOffset;
TextIndex fClusterStart;
@@ -229,7 +222,13 @@
SkSTArray<128, SkRect, true> fBounds;
SkSTArray<128, SkScalar, true> fShifts; // For formatting (letter/word spacing)
+
+ SkFontMetrics fFontMetrics;
+ const SkScalar fHeightMultiplier;
+
bool fSpaced;
+ bool fEllipsis;
+ uint8_t fBidiLevel;
};
struct CodepointRepresentation {