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

Side by Side Diff: components/favicon/core/fallback_icon_service.cc

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, 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/favicon/core/fallback_icon_service.h" 5 #include "components/favicon/core/fallback_icon_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 base::string16 icon_text = GetFallbackIconText(icon_url); 72 base::string16 icon_text = GetFallbackIconText(icon_url);
73 if (icon_text.empty()) 73 if (icon_text.empty())
74 return; 74 return;
75 int font_size = static_cast<int>(size * style.font_size_ratio); 75 int font_size = static_cast<int>(size * style.font_size_ratio);
76 if (font_size <= 0) 76 if (font_size <= 0)
77 return; 77 return;
78 78
79 canvas->DrawStringRectWithFlags( 79 canvas->DrawStringRectWithFlags(
80 icon_text, 80 icon_text,
81 gfx::FontList(fallback_icon_client_->GetFontNameList(), gfx::Font::NORMAL, 81 gfx::FontList(fallback_icon_client_->GetFontNameList(), gfx::Font::NORMAL,
82 font_size), 82 font_size, gfx::Font::Weight::NORMAL),
83 style.text_color, 83 style.text_color, gfx::Rect(kOffsetX, kOffsetY, size, size),
84 gfx::Rect(kOffsetX, kOffsetY, size, size),
85 gfx::Canvas::TEXT_ALIGN_CENTER); 84 gfx::Canvas::TEXT_ALIGN_CENTER);
86 } 85 }
87 86
88 } // namespace favicon 87 } // namespace favicon
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/pepper_flash_renderer_host.cc ('k') | content/browser/renderer_host/sandbox_ipc_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698