Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: chrome/browser/ui/views/infobars/translate_infobar_base.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/infobars/translate_infobar_base.h" 5 #include "chrome/browser/ui/views/infobars/translate_infobar_base.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/translate/translate_infobar_delegate.h" 8 #include "chrome/browser/translate/translate_infobar_delegate.h"
9 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h" 9 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h"
10 #include "chrome/browser/ui/views/infobars/before_translate_infobar.h" 10 #include "chrome/browser/ui/views/infobars/before_translate_infobar.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const views::Background& TranslateInfoBarBase::GetBackground() { 121 const views::Background& TranslateInfoBarBase::GetBackground() {
122 return GetDelegate()->IsError() ? error_background_ : *background(); 122 return GetDelegate()->IsError() ? error_background_ : *background();
123 } 123 }
124 124
125 void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas, 125 void TranslateInfoBarBase::FadeBackground(gfx::Canvas* canvas,
126 double animation_value, 126 double animation_value,
127 const views::Background& background) { 127 const views::Background& background) {
128 // Draw the background into an offscreen buffer with alpha value per animation 128 // Draw the background into an offscreen buffer with alpha value per animation
129 // value, then blend it back into the current canvas. 129 // value, then blend it back into the current canvas.
130 canvas->SaveLayerAlpha(static_cast<int>(animation_value * 255)); 130 canvas->SaveLayerAlpha(static_cast<int>(animation_value * 255));
131 canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 131 canvas->AsCanvasSkia()->skia_canvas()->drawARGB(
132 0, 255, 255, 255, SkXfermode::kClear_Mode);
132 background.Paint(canvas, this); 133 background.Paint(canvas, this);
133 canvas->Restore(); 134 canvas->Restore();
134 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698