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

Unified Diff: skia/ext/skia_utils_base.cc

Issue 1877673002: Move legacyCreateTypeface to SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DEPS change now that Skia change has landed. Created 4 years, 8 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
« no previous file with comments | « skia/ext/skia_utils_base.h ('k') | third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_base.cc
diff --git a/skia/ext/skia_utils_base.cc b/skia/ext/skia_utils_base.cc
index f026c07adecd83592f51395ff651397e5e1ff096..335eb27d70719f23de7dc2abefe6dba822085e27 100644
--- a/skia/ext/skia_utils_base.cc
+++ b/skia/ext/skia_utils_base.cc
@@ -40,6 +40,24 @@ bool ReadSkFontIdentity(base::PickleIterator* iter,
return true;
}
+bool ReadSkFontStyle(base::PickleIterator* iter, SkFontStyle* style) {
+ uint16_t reply_weight;
+ uint16_t reply_width;
+ uint16_t reply_slant;
+
+ if (!iter->ReadUInt16(&reply_weight) ||
+ !iter->ReadUInt16(&reply_width) ||
+ !iter->ReadUInt16(&reply_slant))
+ return false;
+
+ if (style) {
+ *style = SkFontStyle(reply_weight,
+ reply_width,
+ static_cast<SkFontStyle::Slant>(reply_slant));
+ }
+ return true;
+}
+
bool WriteSkString(base::Pickle* pickle, const SkString& str) {
return pickle->WriteData(str.c_str(), str.size());
}
@@ -51,6 +69,12 @@ bool WriteSkFontIdentity(base::Pickle* pickle,
WriteSkString(pickle, identity.fString);
}
+bool WriteSkFontStyle(base::Pickle* pickle, SkFontStyle style) {
+ return pickle->WriteUInt16(style.weight()) &&
+ pickle->WriteUInt16(style.width()) &&
+ pickle->WriteUInt16(style.slant());
+}
+
SkPixelGeometry ComputeDefaultPixelGeometry() {
SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder();
if (SkFontHost::kNONE_LCDOrder == order) {
« no previous file with comments | « skia/ext/skia_utils_base.h ('k') | third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698