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" | |
11 #include "skia/include/SkShader.h" | 10 #include "skia/include/SkShader.h" |
12 #include "chrome/common/gfx/chrome_font.h" | 11 #include "chrome/common/gfx/chrome_font.h" |
13 #include "chrome/common/l10n_util.h" | 12 #include "chrome/common/l10n_util.h" |
14 | 13 |
15 namespace { | 14 namespace { |
16 | 15 |
17 // We make sure that LTR text we draw in an RTL context is modified | 16 // We make sure that LTR text we draw in an RTL context is modified |
18 // appropriately to make sure it maintains it LTR orientation. | 17 // appropriately to make sure it maintains it LTR orientation. |
19 void DoDrawText(HDC hdc, const std::wstring& text, | 18 void DoDrawText(HDC hdc, const std::wstring& text, |
20 RECT* text_bounds, int flags) { | 19 RECT* text_bounds, int flags) { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 text_row[cur_x] = 0; // Make transparent. | 262 text_row[cur_x] = 0; // Make transparent. |
264 } else { | 263 } else { |
265 text_row[cur_x] |= 0xff << SK_A32_SHIFT; // Make opaque. | 264 text_row[cur_x] |= 0xff << SK_A32_SHIFT; // Make opaque. |
266 } | 265 } |
267 } | 266 } |
268 } | 267 } |
269 | 268 |
270 // Draw the halo bitmap with blur. | 269 // Draw the halo bitmap with blur. |
271 drawBitmap(text_bitmap, SkIntToScalar(x - 1), SkIntToScalar(y - 1)); | 270 drawBitmap(text_bitmap, SkIntToScalar(x - 1), SkIntToScalar(y - 1)); |
272 } | 271 } |
OLD | NEW |