diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 23:52:00 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 23:52:00 +0000 |
commit | b0f1a563d2b0ff26b9a6ad81258e08b966c9149a (patch) | |
tree | 8a4fcddb3cbe92bc3ff11a23cc2fc6a8fb099186 /chrome/browser/views/autocomplete | |
parent | 24fc19f3cff67e621cf9962eb135cfed4de7e65c (diff) | |
download | chromium_src-b0f1a563d2b0ff26b9a6ad81258e08b966c9149a.zip chromium_src-b0f1a563d2b0ff26b9a6ad81258e08b966c9149a.tar.gz chromium_src-b0f1a563d2b0ff26b9a6ad81258e08b966c9149a.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/views/autocomplete')
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc index 17d243c..df9565c 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc @@ -15,6 +15,7 @@ #include "chrome/browser/autocomplete/autocomplete_popup_model.h" #include "chrome/browser/views/bubble_border.h" #include "chrome/browser/views/location_bar/location_bar_view.h" +#include "gfx/canvas.h" #include "gfx/canvas_skia.h" #include "gfx/color_utils.h" #include "gfx/insets.h" @@ -272,7 +273,7 @@ AutocompleteResultView::~AutocompleteResultView() { void AutocompleteResultView::Paint(gfx::Canvas* canvas) { const ResultViewState state = GetState(); if (state != NORMAL) - canvas->AsCanvasSkia()->drawColor(GetColor(state, BACKGROUND)); + canvas->drawColor(GetColor(state, BACKGROUND)); // Paint the icon. canvas->DrawBitmapInt(*GetIcon(), MirroredLeftPointForRect(icon_bounds_), @@ -764,7 +765,8 @@ void AutocompletePopupContentsView::Paint(gfx::Canvas* canvas) { // Instead, we paint all our children into a second canvas and use that as a // shader to fill a path representing the round-rect clipping region. This // yields a nice anti-aliased edge. - gfx::CanvasSkia contents_canvas(width(), height(), true); + // TODO(beng): Convert to CanvasSkia + gfx::Canvas contents_canvas(width(), height(), true); contents_canvas.drawColor(GetColor(NORMAL, BACKGROUND)); View::PaintChildren(&contents_canvas); // We want the contents background to be slightly transparent so we can see @@ -786,7 +788,7 @@ void AutocompletePopupContentsView::Paint(gfx::Canvas* canvas) { gfx::Path path; MakeContentsPath(&path, GetLocalBounds(false)); - canvas->AsCanvasSkia()->drawPath(path, paint); + canvas->drawPath(path, paint); // Now we paint the border, so it will be alpha-blended atop the contents. // This looks slightly better in the corners than drawing the contents atop @@ -933,9 +935,8 @@ void AutocompletePopupContentsView::MakeCanvasTransparent( // Allow the window blur effect to show through the popup background. SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ? kGlassPopupAlpha : kOpaquePopupAlpha; - canvas->AsCanvasSkia()->drawColor( - SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha), - SkXfermode::kDstIn_Mode); + canvas->drawColor(SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha), + SkXfermode::kDstIn_Mode); } void AutocompletePopupContentsView::OpenIndex( |