From b0f1a563d2b0ff26b9a6ad81258e08b966c9149a Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Thu, 24 Jun 2010 23:52:00 +0000 Subject: Revert 50784 - 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 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/2811032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50790 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/download_util.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'chrome/browser/download') diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 0042b75..0972ddc 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -27,7 +27,7 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/time_format.h" -#include "gfx/canvas_skia.h" +#include "gfx/canvas.h" #include "gfx/rect.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -225,7 +225,7 @@ void PaintDownloadProgress(gfx::Canvas* canvas, foreground_paint.setShader(shader); foreground_paint.setAntiAlias(true); shader->unref(); - canvas->AsCanvasSkia()->drawPath(path, foreground_paint); + canvas->drawPath(path, foreground_paint); return; } @@ -271,13 +271,12 @@ void PaintDownloadComplete(gfx::Canvas* canvas, SkIntToScalar(complete_bounds.y()), SkIntToScalar(complete_bounds.x() + complete_bounds.width()), SkIntToScalar(complete_bounds.y() + complete_bounds.height())); - canvas->AsCanvasSkia()->saveLayerAlpha( - &bounds, - static_cast(255.0 * opacity), - SkCanvas::kARGB_ClipLayer_SaveFlag); - canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); + canvas->saveLayerAlpha(&bounds, + static_cast(255.0 * opacity), + SkCanvas::kARGB_ClipLayer_SaveFlag); + canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); canvas->DrawBitmapInt(*complete, complete_bounds.x(), complete_bounds.y()); - canvas->AsCanvasSkia()->restore(); + canvas->restore(); } // Load a language dependent height so that the dangerous download confirmation -- cgit v1.1