| Index: ui/gfx/canvas.cc
|
| diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
|
| index 2b0f5046cf0ced0cccf96b9274e1b8965af1e667..5c7b0dacfe6ca4fcb7a1b182612d1e93a89676f9 100644
|
| --- a/ui/gfx/canvas.cc
|
| +++ b/ui/gfx/canvas.cc
|
| @@ -11,7 +11,7 @@
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "third_party/skia/include/effects/SkGradientShader.h"
|
| #include "ui/gfx/canvas.h"
|
| -#include "ui/gfx/font.h"
|
| +#include "ui/gfx/font_list.h"
|
| #include "ui/gfx/rect.h"
|
| #include "ui/gfx/size_conversions.h"
|
| #include "ui/gfx/skia_util.h"
|
| @@ -87,6 +87,14 @@ void Canvas::RecreateBackingCanvas(const gfx::Size& size,
|
| }
|
|
|
| // static
|
| +int Canvas::GetStringWidth(const base::string16& text,
|
| + const gfx::FontList& font_list) {
|
| + int width = 0, height = 0;
|
| + Canvas::SizeStringInt(text, font_list, &width, &height, 0, NO_ELLIPSIS);
|
| + return width;
|
| +}
|
| +
|
| +// static
|
| int Canvas::GetStringWidth(const base::string16& text, const gfx::Font& font) {
|
| int width = 0, height = 0;
|
| Canvas::SizeStringInt(text, font, &width, &height, 0, NO_ELLIPSIS);
|
| @@ -409,6 +417,28 @@ void Canvas::DrawImageInPath(const gfx::ImageSkia& image,
|
| canvas_->drawPath(path, p);
|
| }
|
|
|
| +void Canvas::DrawString(const base::string16& text,
|
| + const gfx::FontList& font_list,
|
| + SkColor color,
|
| + const gfx::Rect& display_rect) {
|
| + DrawStringWithAligned(text, font_list, color, display_rect,
|
| + DefaultCanvasTextAlignment());
|
| +}
|
| +
|
| +void Canvas::DrawStringWithAligned(const base::string16& text,
|
| + const gfx::FontList& font_list,
|
| + SkColor color,
|
| + const gfx::Rect& display_rect,
|
| + int flags) {
|
| + DrawStringWithShadows(text,
|
| + font_list,
|
| + color,
|
| + display_rect,
|
| + 0,
|
| + flags,
|
| + ShadowValues());
|
| +}
|
| +
|
| void Canvas::DrawStringInt(const base::string16& text,
|
| const gfx::Font& font,
|
| SkColor color,
|
|
|