| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gfx/canvas_skia.h" | 5 #include "ui/gfx/canvas_skia.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include <cairo/cairo.h> | 9 #include <cairo/cairo.h> |
| 10 #include <pango/pango.h> | 10 #include <pango/pango.h> |
| 11 #include <pango/pangocairo.h> | 11 #include <pango/pangocairo.h> |
| 12 | 12 |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "ui/gfx/font.h" | 15 #include "ui/gfx/font.h" |
| 16 #include "ui/gfx/pango_util.h" | 16 #include "ui/gfx/pango_util.h" |
| 17 #include "ui/gfx/platform_font_pango.h" | 17 #include "ui/gfx/platform_font_pango.h" |
| 18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 19 #include "ui/gfx/skia_util.h" | 19 #include "ui/gfx/skia_util.h" |
| 20 #include "ui/gfx/canvas.h" |
| 20 | 21 |
| 21 using std::max; | 22 using std::max; |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 // Multiply by the text height to determine how much text should be faded | 26 // Multiply by the text height to determine how much text should be faded |
| 26 // when elliding. | 27 // when elliding. |
| 27 const double kFadeWidthFactor = 1.5; | 28 const double kFadeWidthFactor = 1.5; |
| 28 | 29 |
| 29 // End state of the elliding fade. | 30 // End state of the elliding fade. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 int flags) { | 254 int flags) { |
| 254 if (!IntersectsClipRectInt(x, y, w, h)) | 255 if (!IntersectsClipRectInt(x, y, w, h)) |
| 255 return; | 256 return; |
| 256 | 257 |
| 257 gfx::Rect bounds(x, y, w, h); | 258 gfx::Rect bounds(x, y, w, h); |
| 258 DrawStringContext context(this, text, font, bounds, bounds, flags); | 259 DrawStringContext context(this, text, font, bounds, bounds, flags); |
| 259 context.Draw(color); | 260 context.Draw(color); |
| 260 } | 261 } |
| 261 | 262 |
| 262 } // namespace gfx | 263 } // namespace gfx |
| OLD | NEW |