summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/infobars
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 23:30:26 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 23:30:26 +0000
commita219f823813abcf778eceea2eb81f2d3967009a8 (patch)
treee1a9e06b697d539260472a9faa2ea86d5984a4bf /chrome/browser/views/infobars
parent755e1b73a0b4894ecc36401fd042c744e7837844 (diff)
downloadchromium_src-a219f823813abcf778eceea2eb81f2d3967009a8.zip
chromium_src-a219f823813abcf778eceea2eb81f2d3967009a8.tar.gz
chromium_src-a219f823813abcf778eceea2eb81f2d3967009a8.tar.bz2
Canvas refactoring part 3.
- Replace Canvas instance users with CanvasSkia users. - Rename Canvas2 to Canvas. - Delete Canvas subclass of CanvasSkia. This has created some ugliness around the fact that people that used SkCanvas methods on Canvas now have to go through AsCanvasSkia first. This is temporary ugliness that will be eradicated as I incrementally build out the new Canvas API. BUG=none TEST=none Review URL: http://codereview.chromium.org/2825018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/infobars')
-rw-r--r--chrome/browser/views/infobars/translate_infobar_base.cc11
-rw-r--r--chrome/browser/views/infobars/translate_infobars.cc9
2 files changed, 11 insertions, 9 deletions
diff --git a/chrome/browser/views/infobars/translate_infobar_base.cc b/chrome/browser/views/infobars/translate_infobar_base.cc
index aa89609..d344b88 100644
--- a/chrome/browser/views/infobars/translate_infobar_base.cc
+++ b/chrome/browser/views/infobars/translate_infobar_base.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/views/infobars/before_translate_infobar.h"
#include "chrome/browser/views/infobars/translate_message_infobar.h"
#include "chrome/browser/views/infobars/infobar_button_border.h"
-#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include "grit/app_resources.h"
#include "views/controls/button/menu_button.h"
#include "views/controls/image_view.h"
@@ -148,11 +148,12 @@ void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas,
const InfoBarBackground& background) {
// Draw the background into an offscreen buffer with alpha value per animation
// value, then blend it back into the current canvas.
- canvas->saveLayerAlpha(NULL, static_cast<int>(animation_value * 255),
- SkCanvas::kARGB_NoClipLayer_SaveFlag);
- canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
+ canvas->AsCanvasSkia()->saveLayerAlpha(
+ NULL, static_cast<int>(animation_value * 255),
+ SkCanvas::kARGB_NoClipLayer_SaveFlag);
+ canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
background.Paint(canvas, this);
- canvas->restore();
+ canvas->AsCanvasSkia()->restore();
}
// TranslateInfoBarDelegate views specific method:
diff --git a/chrome/browser/views/infobars/translate_infobars.cc b/chrome/browser/views/infobars/translate_infobars.cc
index 08d4a0f..e395c39 100644
--- a/chrome/browser/views/infobars/translate_infobars.cc
+++ b/chrome/browser/views/infobars/translate_infobars.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/translate/page_translated_details.h"
#include "chrome/browser/views/infobars/infobar_button_border.h"
#include "chrome/browser/views/infobars/infobar_text_button.h"
-#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include "grit/app_resources.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -757,11 +757,12 @@ void TranslateInfoBar::FadeBackground(gfx::Canvas* canvas,
double animation_value, TranslateInfoBarDelegate::TranslateState state) {
// Draw background into an offscreen buffer with alpha value per animation
// value, then blend it back into the current canvas.
- canvas->saveLayerAlpha(NULL, static_cast<int>(animation_value * 255),
+ canvas->AsCanvasSkia()->saveLayerAlpha(
+ NULL, static_cast<int>(animation_value * 255),
SkCanvas::kARGB_NoClipLayer_SaveFlag);
- canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
+ canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
GetBackground(state)->Paint(canvas, this);
- canvas->restore();
+ canvas->AsCanvasSkia()->restore();
}
inline TranslateInfoBarDelegate* TranslateInfoBar::GetDelegate() const {