aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-02-13 11:49:07 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-13 11:49:07 -0800
commitb5d0ce6bd4fef192a9908562b5a01bc01683c7bb (patch)
treeb75aa964b6007f00be34983efb04f8c0ffb81177 /src
parente6eddf7dd85add7da41f22f2643bdd573ad1f1cf (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
Diffstat (limited to 'src')
-rw-r--r--src/ports/SkFontConfigParser_android.h5
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