OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/common/gfx/chrome_canvas.h" | 5 #include "chrome/common/gfx/chrome_canvas.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
12 #include "skia/include/SkShader.h" | 12 #include "skia/include/SkShader.h" |
13 #include "skia/include/SkPaint.h" | 13 #include "skia/include/SkPaint.h" |
14 #include "chrome/common/gfx/chrome_font.h" | 14 #include "chrome/common/gfx/chrome_font.h" |
15 #include "chrome/common/l10n_util.h" | 15 #include "chrome/common/l10n_util.h" |
16 | 16 |
17 ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) | 17 ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) |
18 : gfx::PlatformCanvasLinux(width, height, is_opaque) { | 18 : skia::PlatformCanvasLinux(width, height, is_opaque) { |
19 } | 19 } |
20 | 20 |
21 ChromeCanvas::ChromeCanvas() : gfx::PlatformCanvasLinux() { | 21 ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasLinux() { |
22 } | 22 } |
23 | 23 |
24 ChromeCanvas::~ChromeCanvas() { | 24 ChromeCanvas::~ChromeCanvas() { |
25 } | 25 } |
26 | 26 |
27 // static | 27 // static |
28 void ChromeCanvas::SizeStringInt(const std::wstring& text, | 28 void ChromeCanvas::SizeStringInt(const std::wstring& text, |
29 const ChromeFont& font, | 29 const ChromeFont& font, |
30 int* width, int* height, int flags) { | 30 int* width, int* height, int flags) { |
31 // TODO(port): @flags is currently ignored | 31 // TODO(port): @flags is currently ignored |
(...skipping 25 matching lines...) Expand all Loading... |
57 } | 57 } |
58 | 58 |
59 void ChromeCanvas::DrawStringInt(const std::wstring& text, | 59 void ChromeCanvas::DrawStringInt(const std::wstring& text, |
60 const ChromeFont& font, | 60 const ChromeFont& font, |
61 const SkColor& color, | 61 const SkColor& color, |
62 int x, int y, | 62 int x, int y, |
63 int w, int h) { | 63 int w, int h) { |
64 DrawStringInt(text, font, color, x, y, w, h, | 64 DrawStringInt(text, font, color, x, y, w, h, |
65 l10n_util::DefaultCanvasTextAlignment()); | 65 l10n_util::DefaultCanvasTextAlignment()); |
66 } | 66 } |
OLD | NEW |