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

Unified Diff: views/controls/menu/menu_item_view_win.cc

Issue 2825018: 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: views/controls/menu/menu_item_view_win.cc
===================================================================
--- views/controls/menu/menu_item_view_win.cc (revision 50661)
+++ views/controls/menu/menu_item_view_win.cc (working copy)
@@ -8,7 +8,7 @@
#include <Vssym32.h>
#include "app/l10n_util.h"
-#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include "gfx/native_theme_win.h"
#include "grit/app_strings.h"
#include "views/controls/menu/menu_config.h"
@@ -34,7 +34,7 @@
GetChildViewCount() == 0);
int state = render_selection ? MPI_HOT :
(IsEnabled() ? MPI_NORMAL : MPI_DISABLED);
- HDC dc = canvas->beginPlatformPaint();
+ HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint();
// The gutter is rendered before the background.
if (config.render_gutter && !for_drag) {
@@ -87,10 +87,10 @@
// foreground and background colors are for the text to draw the correct
// halo. Instead, just draw black on white, which will look good in most
// cases.
- canvas->DrawStringWithHalo(GetTitle(), font, 0x00000000, 0xFFFFFFFF,
- text_bounds.x(), text_bounds.y(),
- text_bounds.width(), text_bounds.height(),
- GetRootMenuItem()->GetDrawStringFlags());
+ canvas->AsCanvasSkia()->DrawStringWithHalo(
+ GetTitle(), font, 0x00000000, 0xFFFFFFFF, text_bounds.x(),
+ text_bounds.y(), text_bounds.width(), text_bounds.height(),
+ GetRootMenuItem()->GetDrawStringFlags());
} else {
canvas->DrawStringInt(GetTitle(), font, fg_color,
text_bounds.x(), text_bounds.y(), text_bounds.width(),
@@ -131,7 +131,7 @@
NativeTheme::MENU, dc, MENU_POPUPSUBMENU, state_id, &arrow_rect,
arrow_direction, render_selection);
}
- canvas->endPlatformPaint();
+ canvas->AsCanvasSkia()->endPlatformPaint();
}
void MenuItemView::PaintCheck(HDC dc,
int state_id,

Powered by Google App Engine
This is Rietveld 408576698