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

Unified Diff: ui/views/controls/label.cc

Issue 9562038: ui/gfx: Make gfx::Canvas inherit from gfx::CanvasSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 10 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
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 3c93e3cff14660f0aedcabf43efe157fe764ba7a..1fcbe0648645b9d1e0c1db86f925dae5fdbd034b 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -292,7 +292,7 @@ gfx::Size Label::GetTextSize() const {
// wide the text wants to be.
int flags = ComputeMultiLineFlags();
if (!is_multi_line_)
- flags |= gfx::Canvas::NO_ELLIPSIS;
+ flags |= gfx::CanvasSkia::NO_ELLIPSIS;
gfx::CanvasSkia::SizeStringInt(text_, font_, &w, &h, flags);
text_size_.SetSize(w, h);
text_size_valid_ = true;
@@ -319,7 +319,7 @@ void Label::OnPaint(gfx::Canvas* canvas) {
PaintText(canvas, paint_text, text_bounds, flags);
}
-void Label::OnPaintBackground(gfx::Canvas* canvas) {
+void Label::OnPaintBackground(gfx::CanvasSkia* canvas) {
const Background* bg = contains_mouse_ ? GetMouseOverBackground() : NULL;
if (!bg)
bg = background();
@@ -430,26 +430,26 @@ int Label::ComputeMultiLineFlags() const {
if (!is_multi_line_)
return 0;
- int flags = gfx::Canvas::MULTI_LINE;
+ int flags = gfx::CanvasSkia::MULTI_LINE;
#if !defined(OS_WIN)
// Don't elide multiline labels on Linux.
// Todo(davemoore): Do we depend on eliding multiline text?
// Pango insists on limiting the number of lines to one if text is
// elided. You can get around this if you can pass a maximum height
// but we don't currently have that data when we call the pango code.
- flags |= gfx::Canvas::NO_ELLIPSIS;
+ flags |= gfx::CanvasSkia::NO_ELLIPSIS;
#endif
if (allow_character_break_)
- flags |= gfx::Canvas::CHARACTER_BREAK;
+ flags |= gfx::CanvasSkia::CHARACTER_BREAK;
switch (horiz_alignment_) {
case ALIGN_LEFT:
- flags |= gfx::Canvas::TEXT_ALIGN_LEFT;
+ flags |= gfx::CanvasSkia::TEXT_ALIGN_LEFT;
break;
case ALIGN_CENTER:
- flags |= gfx::Canvas::TEXT_ALIGN_CENTER;
+ flags |= gfx::CanvasSkia::TEXT_ALIGN_CENTER;
break;
case ALIGN_RIGHT:
- flags |= gfx::Canvas::TEXT_ALIGN_RIGHT;
+ flags |= gfx::CanvasSkia::TEXT_ALIGN_RIGHT;
break;
}
return flags;
@@ -498,9 +498,9 @@ void Label::CalculateDrawStringParams(string16* paint_text,
base::i18n::TextDirection direction =
base::i18n::GetFirstStrongCharacterDirection(GetText());
if (direction == base::i18n::RIGHT_TO_LEFT)
- *flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY;
+ *flags |= gfx::CanvasSkia::FORCE_RTL_DIRECTIONALITY;
else
- *flags |= gfx::Canvas::FORCE_LTR_DIRECTIONALITY;
+ *flags |= gfx::CanvasSkia::FORCE_LTR_DIRECTIONALITY;
}
}

Powered by Google App Engine
This is Rietveld 408576698