diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 02:23:56 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 02:23:56 +0000 |
commit | 0834e1b153c28dec0ae9e90080ad7a106f1c8c84 (patch) | |
tree | 3a939399a68c91722271573bf2589266d642d58f /ui/gfx/canvas.cc | |
parent | c8678d8870826350577c3f00e922e442abb647c9 (diff) | |
download | chromium_src-0834e1b153c28dec0ae9e90080ad7a106f1c8c84.zip chromium_src-0834e1b153c28dec0ae9e90080ad7a106f1c8c84.tar.gz chromium_src-0834e1b153c28dec0ae9e90080ad7a106f1c8c84.tar.bz2 |
ash: Better and faster text shadows.
- Add a DrawStringWithShadows that draws text with shadows to canvas skia
and RenderText;
- Use DrawStringWithShadows in DropShadowLabel for better and faster text
shadows;
BUG=121694
TEST=Verify fix for issue 121694.
Review URL: http://codereview.chromium.org/10008027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/canvas.cc')
-rw-r--r-- | ui/gfx/canvas.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc index ded3e2f7..883a7ce 100644 --- a/ui/gfx/canvas.cc +++ b/ui/gfx/canvas.cc @@ -13,6 +13,7 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/rect.h" +#include "ui/gfx/shadow_value.h" #include "ui/gfx/skia_util.h" #include "ui/gfx/transform.h" @@ -340,6 +341,19 @@ void Canvas::DrawStringInt(const string16& text, display_rect.width(), display_rect.height()); } +void Canvas::DrawStringInt(const string16& text, + const gfx::Font& font, + SkColor color, + int x, int y, int w, int h, + int flags) { + DrawStringWithShadows(text, + font, + color, + gfx::Rect(x, y, w, h), + flags, + std::vector<ShadowValue>()); +} + void Canvas::TileImageInt(const SkBitmap& bitmap, int x, int y, int w, int h) { TileImageInt(bitmap, 0, 0, x, y, w, h); @@ -389,4 +403,9 @@ bool Canvas::IntersectsClipRectInt(int x, int y, int w, int h) { SkIntToScalar(y + h)); } +bool Canvas::IntersectsClipRect(const gfx::Rect& rect) { + return IntersectsClipRectInt(rect.x(), rect.y(), + rect.width(), rect.height()); +} + } // namespace gfx |