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

Unified Diff: skia/ext/SkFontHost_fontconfig_ipc.cpp

Issue 147005: Linux: fix fake italics for font's without italic variants. (Closed)
Patch Set: ... Created 11 years, 6 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/SkFontHost_fontconfig_ipc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/SkFontHost_fontconfig_ipc.cpp
diff --git a/skia/ext/SkFontHost_fontconfig_ipc.cpp b/skia/ext/SkFontHost_fontconfig_ipc.cpp
index e3868f4ee7f8c359cbc7a1faa02338c9f7d1fd63..ada7bc9bcc56eef38696b76b85f2007f50ef6e6f 100644
--- a/skia/ext/SkFontHost_fontconfig_ipc.cpp
+++ b/skia/ext/SkFontHost_fontconfig_ipc.cpp
@@ -39,15 +39,17 @@ FontConfigIPC::~FontConfigIPC() {
bool FontConfigIPC::Match(std::string* result_family,
unsigned* result_fileid,
bool fileid_valid, unsigned fileid,
- const std::string& family, int is_bold,
- int is_italic) {
+ const std::string& family, bool* is_bold,
+ bool* is_italic) {
Pickle request;
request.WriteInt(METHOD_MATCH);
request.WriteBool(fileid_valid);
if (fileid_valid)
request.WriteUInt32(fileid);
- request.WriteBool(is_bold);
- request.WriteBool(is_italic);
+
+ request.WriteBool(is_bold && *is_bold);
+ request.WriteBool(is_bold && *is_italic);
+
request.WriteString(family);
uint8_t reply_buf[512];
@@ -66,8 +68,11 @@ bool FontConfigIPC::Match(std::string* result_family,
uint32_t reply_fileid;
std::string reply_family;
+ bool resulting_bold, resulting_italic;
if (!reply.ReadUInt32(&iter, &reply_fileid) ||
- !reply.ReadString(&iter, &reply_family)) {
+ !reply.ReadString(&iter, &reply_family) ||
+ !reply.ReadBool(&iter, &resulting_bold) ||
+ !reply.ReadBool(&iter, &resulting_italic)) {
return false;
}
@@ -75,6 +80,11 @@ bool FontConfigIPC::Match(std::string* result_family,
if (result_family)
*result_family = reply_family;
+ if (is_bold)
+ *is_bold = resulting_bold;
+ if (is_italic)
+ *is_italic = resulting_italic;
+
return true;
}
« no previous file with comments | « skia/ext/SkFontHost_fontconfig_ipc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698