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

Unified Diff: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc

Issue 2811032: Revert 50784 - Canvas refactoring part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
===================================================================
--- chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc (revision 50789)
+++ chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc (working copy)
@@ -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 @@
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 @@
// 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 @@
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 @@
// 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(
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_unittest.cc ('k') | chrome/browser/views/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698