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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp

Issue 2031363002: Use a FontPlatformData pointer for FontDataCache's key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Crashes, lifecycle issues fixed Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if (fallbackFont.isItalic && description.style() == FontStyleNormal) 127 if (fallbackFont.isItalic && description.style() == FontStyleNormal)
128 description.setStyle(FontStyleItalic); 128 description.setStyle(FontStyleItalic);
129 if (!fallbackFont.isItalic && (description.style() == FontStyleItalic || des cription.style() == FontStyleOblique)) { 129 if (!fallbackFont.isItalic && (description.style() == FontStyleItalic || des cription.style() == FontStyleOblique)) {
130 shouldSetSyntheticItalic = true; 130 shouldSetSyntheticItalic = true;
131 description.setStyle(FontStyleNormal); 131 description.setStyle(FontStyleNormal);
132 } 132 }
133 133
134 FontPlatformData* substitutePlatformData = getFontPlatformData(description, creationParams); 134 FontPlatformData* substitutePlatformData = getFontPlatformData(description, creationParams);
135 if (!substitutePlatformData) 135 if (!substitutePlatformData)
136 return nullptr; 136 return nullptr;
137 FontPlatformData platformData = FontPlatformData(*substitutePlatformData); 137
138 platformData.setSyntheticBold(shouldSetSyntheticBold); 138 std::unique_ptr<FontPlatformData> platformData(new FontPlatformData(*substit utePlatformData));
139 platformData.setSyntheticItalic(shouldSetSyntheticItalic); 139 platformData->setSyntheticBold(shouldSetSyntheticBold);
140 return fontDataFromFontPlatformData(&platformData, DoNotRetain); 140 platformData->setSyntheticItalic(shouldSetSyntheticItalic);
141 return fontDataFromFontPlatformData(platformData.get(), DoNotRetain);
141 } 142 }
142 143
143 #endif // !OS(ANDROID) 144 #endif // !OS(ANDROID)
144 145
145 } // namespace blink 146 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698