summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/autocomplete
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/autocomplete
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/autocomplete')
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
index df9565c..17d243c 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -15,7 +15,6 @@
#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"
@@ -273,7 +272,7 @@ AutocompleteResultView::~AutocompleteResultView() {
void AutocompleteResultView::Paint(gfx::Canvas* canvas) {
const ResultViewState state = GetState();
if (state != NORMAL)
- canvas->drawColor(GetColor(state, BACKGROUND));
+ canvas->AsCanvasSkia()->drawColor(GetColor(state, BACKGROUND));
// Paint the icon.
canvas->DrawBitmapInt(*GetIcon(), MirroredLeftPointForRect(icon_bounds_),
@@ -765,8 +764,7 @@ 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.
- // TODO(beng): Convert to CanvasSkia
- gfx::Canvas contents_canvas(width(), height(), true);
+ gfx::CanvasSkia 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
@@ -788,7 +786,7 @@ void AutocompletePopupContentsView::Paint(gfx::Canvas* canvas) {
gfx::Path path;
MakeContentsPath(&path, GetLocalBounds(false));
- canvas->drawPath(path, paint);
+ canvas->AsCanvasSkia()->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
@@ -935,8 +933,9 @@ void AutocompletePopupContentsView::MakeCanvasTransparent(
// Allow the window blur effect to show through the popup background.
SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ?
kGlassPopupAlpha : kOpaquePopupAlpha;
- canvas->drawColor(SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha),
- SkXfermode::kDstIn_Mode);
+ canvas->AsCanvasSkia()->drawColor(
+ SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha),
+ SkXfermode::kDstIn_Mode);
}
void AutocompletePopupContentsView::OpenIndex(