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

Unified Diff: ui/base/resource/resource_bundle.h

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 7 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 | « ui/base/cocoa/menu_controller_unittest.mm ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.h
diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h
index f58b1269fc8c9f2e3e18f786dff23ab19b5e28ac..c81bcf5bf31e8e2c13e3ce74941866453a3bc888 100644
--- a/ui/base/resource/resource_bundle.h
+++ b/ui/base/resource/resource_bundle.h
@@ -246,12 +246,14 @@ class UI_BASE_EXPORT ResourceBundle {
// The result is always cached and exists for the lifetime of the process.
const gfx::FontList& GetFontListWithDelta(
int size_delta,
- gfx::Font::FontStyle style = gfx::Font::NORMAL);
+ gfx::Font::FontStyle style = gfx::Font::NORMAL,
+ gfx::Font::Weight weight = gfx::Font::Weight::NORMAL);
// Returns the primary font from the FontList given by GetFontListWithDelta().
const gfx::Font& GetFontWithDelta(
int size_delta,
- gfx::Font::FontStyle style = gfx::Font::NORMAL);
+ gfx::Font::FontStyle style = gfx::Font::NORMAL,
+ gfx::Font::Weight weight = gfx::Font::Weight::NORMAL);
// Deprecated. Returns fonts using hard-coded size deltas implied by |style|.
const gfx::FontList& GetFontList(FontStyle style);
@@ -314,6 +316,8 @@ class UI_BASE_EXPORT ResourceBundle {
class ResourceBundleImageSource;
friend class ResourceBundleImageSource;
+ struct FontKey;
+
typedef base::hash_map<int, base::string16> IdToStringMap;
// Ctor/dtor are private, since we're a singleton.
@@ -433,7 +437,7 @@ class UI_BASE_EXPORT ResourceBundle {
// platform base font size, plus style, to the FontList. Cached to avoid
// repeated GDI creation/destruction and font derivation.
// Must be accessed only while holding |images_and_fonts_lock_|.
- std::map<std::pair<int, gfx::Font::FontStyle>, gfx::FontList> font_cache_;
+ std::map<FontKey, gfx::FontList> font_cache_;
base::FilePath overridden_pak_path_;
« no previous file with comments | « ui/base/cocoa/menu_controller_unittest.mm ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698