diff options
author | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-03 19:41:11 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-03 19:41:11 +0000 |
commit | 2885cb33aef2ac47f2678eb065cfe46ea8f75554 (patch) | |
tree | d8e4f741b7d13763283c2b670d892ae4fa8c5bf4 /ui/gfx/canvas.cc | |
parent | a8c2ee0104ef7e4201b0babcd00bcb01c838095b (diff) | |
download | chromium_src-2885cb33aef2ac47f2678eb065cfe46ea8f75554.zip chromium_src-2885cb33aef2ac47f2678eb065cfe46ea8f75554.tar.gz chromium_src-2885cb33aef2ac47f2678eb065cfe46ea8f75554.tar.bz2 |
Extend gfx::canvas to allow DrawBitmapInt(..., alpha). This allows callers to
specify an alpha directly, rather than forcing them to bracket the call with
SaveLayerAlpha(alpha)
DrawBitmapInt()
Restore()
Should be 2x faster or better.
Review URL: https://codereview.chromium.org/11046020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/canvas.cc')
-rw-r--r-- | ui/gfx/canvas.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc index 1a87c73..c4f98d6 100644 --- a/ui/gfx/canvas.cc +++ b/ui/gfx/canvas.cc @@ -287,6 +287,12 @@ void Canvas::DrawImageInt(const gfx::ImageSkia& image, int x, int y) { DrawImageInt(image, x, y, paint); } +void Canvas::DrawImageInt(const gfx::ImageSkia& image, int x, int y, uint8 a) { + SkPaint paint; + paint.setAlpha(a); + DrawImageInt(image, x, y, paint); +} + void Canvas::DrawImageInt(const gfx::ImageSkia& image, int x, int y, const SkPaint& paint) { |