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" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // of the truncated string and not on the right hand side. | 84 // of the truncated string and not on the right hand side. |
85 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) | 85 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) |
86 f |= DT_RTLREADING; | 86 f |= DT_RTLREADING; |
87 | 87 |
88 return f; | 88 return f; |
89 } | 89 } |
90 | 90 |
91 } // anonymous namespace | 91 } // anonymous namespace |
92 | 92 |
93 ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) | 93 ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) |
94 : gfx::PlatformCanvasWin(width, height, is_opaque) { | 94 : skia::PlatformCanvasWin(width, height, is_opaque) { |
95 } | 95 } |
96 | 96 |
97 ChromeCanvas::ChromeCanvas() : gfx::PlatformCanvasWin() { | 97 ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasWin() { |
98 } | 98 } |
99 | 99 |
100 ChromeCanvas::~ChromeCanvas() { | 100 ChromeCanvas::~ChromeCanvas() { |
101 } | 101 } |
102 | 102 |
103 // static | 103 // static |
104 void ChromeCanvas::SizeStringInt(const std::wstring& text, | 104 void ChromeCanvas::SizeStringInt(const std::wstring& text, |
105 const ChromeFont& font, | 105 const ChromeFont& font, |
106 int *width, int *height, int flags) { | 106 int *width, int *height, int flags) { |
107 HDC dc = GetDC(NULL); | 107 HDC dc = GetDC(NULL); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 DrawStringInt(text, font, color, x, y, w, h, | 159 DrawStringInt(text, font, color, x, y, w, h, |
160 l10n_util::DefaultCanvasTextAlignment()); | 160 l10n_util::DefaultCanvasTextAlignment()); |
161 } | 161 } |
162 | 162 |
163 void ChromeCanvas::DrawStringInt(const std::wstring& text, | 163 void ChromeCanvas::DrawStringInt(const std::wstring& text, |
164 const ChromeFont& font, | 164 const ChromeFont& font, |
165 const SkColor& color, | 165 const SkColor& color, |
166 int x, int y, int w, int h, int flags) { | 166 int x, int y, int w, int h, int flags) { |
167 DrawStringInt(text, font.hfont(), color, x, y, w, h, flags); | 167 DrawStringInt(text, font.hfont(), color, x, y, w, h, flags); |
168 } | 168 } |
OLD | NEW |