diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 23:10:55 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 23:10:55 +0000 |
commit | 605ead6be06bd0e8a98f5163c97de572df5c2dfd (patch) | |
tree | 9dab4887e8f12bbb243ff8e8ecc73fb735b67991 /chrome/browser/gtk/tabs | |
parent | 385f4973b13bcbd2deecfae311abfe10eaf3aee9 (diff) | |
download | chromium_src-605ead6be06bd0e8a98f5163c97de572df5c2dfd.zip chromium_src-605ead6be06bd0e8a98f5163c97de572df5c2dfd.tar.gz chromium_src-605ead6be06bd0e8a98f5163c97de572df5c2dfd.tar.bz2 |
Paint the hover animation state when painting just the favicon.
BUG=20658
Review URL: http://codereview.chromium.org/173630
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs')
-rw-r--r-- | chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index 849ca4a..042ff68 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -371,6 +371,26 @@ void TabRendererGtk::PaintFavIconArea(GdkEventExpose* event) { favicon_bounds_.x(), favicon_bounds_.y(), favicon_bounds_.width(), favicon_bounds_.height()); + // Draw our hover state. + if (!IsSelected()) { + Animation* animation = hover_animation_.get(); + if (animation->GetCurrentValue() > 0) { + SkRect bounds; + bounds.set(favicon_bounds_.x(), favicon_bounds_.y(), + favicon_bounds_.right(), favicon_bounds_.bottom()); + canvas.saveLayerAlpha(&bounds, + static_cast<int>(animation->GetCurrentValue() * kHoverOpacity * 0xff), + SkCanvas::kARGB_ClipLayer_SaveFlag); + canvas.drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); + SkBitmap* active_bg = theme_provider_->GetBitmapNamed(IDR_THEME_TOOLBAR); + canvas.TileImageInt(*active_bg, + x() + favicon_bounds_.x(), favicon_bounds_.y(), + favicon_bounds_.x(), favicon_bounds_.y(), + favicon_bounds_.width(), favicon_bounds_.height()); + canvas.restore(); + } + } + // Now paint the icon. PaintIcon(&canvas); } |