diff options
author | bungeman <bungeman@google.com> | 2015-02-13 11:49:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-13 11:49:07 -0800 |
commit | b5d0ce6bd4fef192a9908562b5a01bc01683c7bb (patch) | |
tree | b75aa964b6007f00be34983efb04f8c0ffb81177 | |
parent | e6eddf7dd85add7da41f22f2643bdd573ad1f1cf (diff) |
FontFamily SkTArrays can be moved.
The FontFamily type in SkFontConfigParser_android.h contains two fields
of type SkTArray. Both of these contain types which can be moved
instead of calling constructors and destructors on resize. This change
avoids a number of unneeded SkString refs and unrefs.
Review URL: https://codereview.chromium.org/929473002
-rw-r--r-- | src/ports/SkFontConfigParser_android.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ports/SkFontConfigParser_android.h b/src/ports/SkFontConfigParser_android.h index 2302c7712e..6dbf383590 100644 --- a/src/ports/SkFontConfigParser_android.h +++ b/src/ports/SkFontConfigParser_android.h @@ -60,6 +60,7 @@ enum FontVariants { }; typedef uint32_t FontVariant; +// Must remain trivially movable (can be memmoved). struct FontFileInfo { FontFileInfo() : fIndex(0), fWeight(0) { } @@ -83,8 +84,8 @@ struct FontFamily { , fBasePath(basePath) { } - SkTArray<SkString> fNames; - SkTArray<FontFileInfo> fFonts; + SkTArray<SkString, true> fNames; + SkTArray<FontFileInfo, true> fFonts; SkLanguage fLanguage; FontVariant fVariant; int fOrder; // internal to SkFontConfigParser |