diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 22:02:11 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 22:02:11 +0000 |
commit | b9527d57c08210ca3273633048445722b3244357 (patch) | |
tree | 155a1add971e8d8fbc24b866d0a3bdc318f5f468 /views | |
parent | 937105b42b6f50d9a29aa7180b939324da80911e (diff) | |
download | chromium_src-b9527d57c08210ca3273633048445722b3244357.zip chromium_src-b9527d57c08210ca3273633048445722b3244357.tar.gz chromium_src-b9527d57c08210ca3273633048445722b3244357.tar.bz2 |
Canvas refactoring phase 4b:
Add BeginPlatformPaint/EndPlatformPaint calls to gfx::Canvas. BeginPlatformPaint() returns a gfx::NativeDrawingContext.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2840029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/menu_item_view_win.cc | 4 | ||||
-rw-r--r-- | views/controls/menu/menu_scroll_view_container.cc | 8 | ||||
-rw-r--r-- | views/controls/menu/menu_separator_win.cc | 4 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.cc | 4 | ||||
-rw-r--r-- | views/window/dialog_client_view.cc | 4 |
5 files changed, 12 insertions, 12 deletions
diff --git a/views/controls/menu/menu_item_view_win.cc b/views/controls/menu/menu_item_view_win.cc index b491092..30a8982e 100644 --- a/views/controls/menu/menu_item_view_win.cc +++ b/views/controls/menu/menu_item_view_win.cc @@ -34,7 +34,7 @@ void MenuItemView::Paint(gfx::Canvas* canvas, bool for_drag) { GetChildViewCount() == 0); int state = render_selection ? MPI_HOT : (IsEnabled() ? MPI_NORMAL : MPI_DISABLED); - HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint(); + HDC dc = canvas->BeginPlatformPaint(); // The gutter is rendered before the background. if (config.render_gutter && !for_drag) { @@ -131,7 +131,7 @@ void MenuItemView::Paint(gfx::Canvas* canvas, bool for_drag) { NativeTheme::MENU, dc, MENU_POPUPSUBMENU, state_id, &arrow_rect, arrow_direction, render_selection); } - canvas->AsCanvasSkia()->endPlatformPaint(); + canvas->EndPlatformPaint(); } void MenuItemView::PaintCheck(HDC dc, int state_id, diff --git a/views/controls/menu/menu_scroll_view_container.cc b/views/controls/menu/menu_scroll_view_container.cc index d3a7ae8..cb92284 100644 --- a/views/controls/menu/menu_scroll_view_container.cc +++ b/views/controls/menu/menu_scroll_view_container.cc @@ -83,14 +83,14 @@ class MenuScrollButton : public View { const MenuConfig& config = MenuConfig::instance(); #if defined(OS_WIN) - HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint(); + HDC dc = canvas->BeginPlatformPaint(); // The background. RECT item_bounds = { 0, 0, width(), height() }; NativeTheme::instance()->PaintMenuItemBackground( NativeTheme::MENU, dc, MENU_POPUPITEM, MPI_NORMAL, false, &item_bounds); - canvas->AsCanvasSkia()->endPlatformPaint(); + canvas->EndPlatformPaint(); SkColor arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); #else @@ -185,11 +185,11 @@ void MenuScrollViewContainer::PaintBackground(gfx::Canvas* canvas) { } #if defined(OS_WIN) - HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint(); + HDC dc = canvas->BeginPlatformPaint(); RECT bounds = {0, 0, width(), height()}; NativeTheme::instance()->PaintMenuBackground( NativeTheme::MENU, dc, MENU_POPUPBACKGROUND, 0, &bounds); - canvas->AsCanvasSkia()->endPlatformPaint(); + canvas->EndPlatformPaint(); #elif defined(OS_CHROMEOS) static const SkColor kGradientColors[2] = { SK_ColorWHITE, diff --git a/views/controls/menu/menu_separator_win.cc b/views/controls/menu/menu_separator_win.cc index ed3f34f..78331bb 100644 --- a/views/controls/menu/menu_separator_win.cc +++ b/views/controls/menu/menu_separator_win.cc @@ -20,7 +20,7 @@ void MenuSeparator::Paint(gfx::Canvas* canvas) { // The gutter is rendered before the background. int start_x = 0; int start_y = height() / 3; - HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint(); + HDC dc = canvas->BeginPlatformPaint(); if (config.render_gutter) { // If render_gutter is true, we're on Vista and need to render the // gutter, then indent the separator from the gutter. @@ -36,7 +36,7 @@ void MenuSeparator::Paint(gfx::Canvas* canvas) { RECT separator_bounds = { start_x, start_y, width(), height() }; gfx::NativeTheme::instance()->PaintMenuSeparator( dc, MENU_POPUPSEPARATOR, MPI_NORMAL, &separator_bounds); - canvas->AsCanvasSkia()->endPlatformPaint(); + canvas->EndPlatformPaint(); } gfx::Size MenuSeparator::GetPreferredSize() { diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index 8687325..388cb56 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -36,10 +36,10 @@ class TabBackground : public Background { virtual ~TabBackground() {} virtual void Paint(gfx::Canvas* canvas, View* view) const { - HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint(); + HDC dc = canvas->BeginPlatformPaint(); RECT r = {0, 0, view->width(), view->height()}; gfx::NativeTheme::instance()->PaintTabPanelBackground(dc, &r); - canvas->AsCanvasSkia()->endPlatformPaint(); + canvas->EndPlatformPaint(); } private: diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc index 4f40987..bbc7672 100644 --- a/views/window/dialog_client_view.cc +++ b/views/window/dialog_client_view.cc @@ -418,7 +418,7 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) { if (window()->GetDelegate()->CanResize() || window()->GetDelegate()->CanMaximize()) { #if defined(OS_WIN) - HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint(); + HDC dc = canvas->BeginPlatformPaint(); SIZE gripper_size = { 0, 0 }; gfx::NativeTheme::instance()->GetThemePartSize( gfx::NativeTheme::STATUS, dc, SP_GRIPPER, 1, NULL, TS_TRUE, @@ -434,7 +434,7 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) { RECT native_bounds = size_box_bounds_.ToRECT(); gfx::NativeTheme::instance()->PaintStatusGripper( dc, SP_PANE, 1, 0, &native_bounds); - canvas->AsCanvasSkia()->endPlatformPaint(); + canvas->EndPlatformPaint(); #else NOTIMPLEMENTED(); // TODO(port): paint size box |