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

Unified Diff: ui/gfx/canvas_mac.mm

Issue 14322007: Add line height setting to views::Label & use it for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 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 | « ui/gfx/canvas_android.cc ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_mac.mm
diff --git a/ui/gfx/canvas_mac.mm b/ui/gfx/canvas_mac.mm
index bb99c0666c28cb67352d07217eba3d01361bf633..f1ad6a80e9efb7764da6d88515a62e68de7a6f5f 100644
--- a/ui/gfx/canvas_mac.mm
+++ b/ui/gfx/canvas_mac.mm
@@ -13,11 +13,10 @@
#include "ui/gfx/rect.h"
// Note: This is a temporary Skia-based implementation of the ui/gfx text
-// rendering routines for views/aura. It replaces the stale Cocoa-based
-// implementation. A future |canvas_skia.cc| implementation will supersede
-// this and the other platform-specific implmenentations.
-// Most drawing options, such as alignment and multi-line, are not implemented
-// here.
+// rendering routines for views/aura. It replaces the stale Cocoa-based
+// implementation. A future |canvas_skia.cc| implementation will supersede
+// this and the other platform-specific implmenentations. Most drawing options,
+// such as alignment, multi-line, and line heights are not implemented here.
namespace {
@@ -40,7 +39,11 @@ void Canvas::SizeStringInt(const string16& text,
const gfx::Font& font,
int* width,
int* height,
+ int line_height,
int flags) {
+ DLOG_IF(WARNING, line_height != 0) << "Line heights not implemented.";
+ DLOG_IF(WARNING, flags & Canvas::MULTI_LINE) << "Multi-line not implemented.";
+
NSFont* native_font = font.GetNativeFont();
NSString* ns_string = base::SysUTF16ToNSString(text);
NSDictionary* attributes =
@@ -55,9 +58,12 @@ void Canvas::DrawStringWithShadows(const string16& text,
const gfx::Font& font,
SkColor color,
const gfx::Rect& text_bounds,
+ int line_height,
int flags,
const ShadowValues& shadows) {
- DLOG_IF(WARNING, !shadows.empty()) << "Text shadow not implemented.";
+ DLOG_IF(WARNING, line_height != 0) << "Line heights not implemented.";
+ DLOG_IF(WARNING, flags & Canvas::MULTI_LINE) << "Multi-line not implemented.";
+ DLOG_IF(WARNING, !shadows.empty()) << "Text shadows not implemented.";
skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(
SkTypeface::CreateFromName(
« no previous file with comments | « ui/gfx/canvas_android.cc ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698