diff options
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/menu/menu_win.cc | 7 | ||||
-rw-r--r-- | views/controls/menu/native_menu_win.cc | 6 | ||||
-rw-r--r-- | views/controls/table/native_table_win.cc | 7 | ||||
-rw-r--r-- | views/controls/table/table_view.cc | 9 | ||||
-rw-r--r-- | views/controls/tree/tree_view.cc | 4 |
5 files changed, 16 insertions, 17 deletions
diff --git a/views/controls/menu/menu_win.cc b/views/controls/menu/menu_win.cc index bf5cd4a..c4b6635 100644 --- a/views/controls/menu/menu_win.cc +++ b/views/controls/menu/menu_win.cc @@ -188,9 +188,10 @@ class MenuHostWindow : public ui::WindowImpl { gfx::CanvasSkia canvas(data->icon.width(), data->icon.height(), false); canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); canvas.DrawBitmapInt(data->icon, 0, 0); - canvas.getTopPlatformDevice().drawToHDC(hDC, lpdis->rcItem.left + - kItemLeftMargin, lpdis->rcItem.top + (lpdis->rcItem.bottom - - lpdis->rcItem.top - data->icon.height()) / 2, NULL); + skia::DrawToNativeContext( + &canvas, hDC, lpdis->rcItem.left + kItemLeftMargin, + lpdis->rcItem.top + (lpdis->rcItem.bottom - lpdis->rcItem.top - + data->icon.height()) / 2, NULL); } } else { diff --git a/views/controls/menu/native_menu_win.cc b/views/controls/menu/native_menu_win.cc index 0913a5f..6724891 100644 --- a/views/controls/menu/native_menu_win.cc +++ b/views/controls/menu/native_menu_win.cc @@ -250,8 +250,8 @@ class NativeMenuWin::MenuHostWindow { gfx::CanvasSkia canvas(icon.width(), icon.height(), false); canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); canvas.DrawBitmapInt(icon, 0, 0); - canvas.getTopPlatformDevice().drawToHDC(dc, - draw_item_struct->rcItem.left + kItemLeftMargin, + skia::DrawToNativeContext( + &canvas, dc, draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top - icon.height()) / 2, NULL); } else if (type == ui::MenuModel::TYPE_CHECK && @@ -283,7 +283,7 @@ class NativeMenuWin::MenuHostWindow { &canvas, NativeTheme::kMenuCheck, state, bounds, extra); // Draw checkbox to menu. - canvas.getTopPlatformDevice().drawToHDC(dc, + skia::DrawToNativeContext(&canvas, dc, draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top - config.check_height) / 2, NULL); diff --git a/views/controls/table/native_table_win.cc b/views/controls/table/native_table_win.cc index 56b0c71..25ae1db 100644 --- a/views/controls/table/native_table_win.cc +++ b/views/controls/table/native_table_win.cc @@ -548,10 +548,9 @@ LRESULT NativeTableWin::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { (intersection.right - intersection.left); to_draw.bottom = to_draw.top + (intersection.bottom - intersection.top); - canvas.getTopPlatformDevice().drawToHDC(draw_info->nmcd.hdc, - intersection.left, - intersection.top, - &to_draw); + skia::DrawToNativeContext(&canvas, draw_info->nmcd.hdc, + intersection.left, intersection.top, + &to_draw); r = CDRF_SKIPDEFAULT; } } diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc index 4a3b1cb6..3a6aea6 100644 --- a/views/controls/table/table_view.cc +++ b/views/controls/table/table_view.cc @@ -1158,7 +1158,7 @@ void TableView::PaintAltText() { canvas.DrawStringWithHalo(alt_text_, font, SK_ColorDKGRAY, SK_ColorWHITE, 1, 1, bounds.width() - 2, bounds.height() - 2, gfx::CanvasSkia::DefaultCanvasTextAlignment()); - canvas.getTopPlatformDevice().drawToHDC(dc, bounds.x(), bounds.y(), NULL); + skia::DrawToNativeContext(&canvas, dc, bounds.x(), bounds.y(), NULL); ReleaseDC(GetNativeControlHWND(), dc); } @@ -1273,10 +1273,9 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { (intersection.right - intersection.left); to_draw.bottom = to_draw.top + (intersection.bottom - intersection.top); - canvas.getTopPlatformDevice().drawToHDC(draw_info->nmcd.hdc, - intersection.left, - intersection.top, - &to_draw); + skia::DrawToNativeContext(&canvas, draw_info->nmcd.hdc, + intersection.left, intersection.top, + &to_draw); r = CDRF_SKIPDEFAULT; } } diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc index db75226..c084803 100644 --- a/views/controls/tree/tree_view.cc +++ b/views/controls/tree/tree_view.cc @@ -755,7 +755,7 @@ LRESULT CALLBACK TreeView::TreeWndProc(HWND window, if (canvas.isEmpty()) return 0; - HDC dc = canvas.beginPlatformPaint(); + HDC dc = skia::BeginPlatformPaint(&canvas); if (base::i18n::IsRTL()) { // gfx::CanvasSkia ends up configuring the DC with a mode of // GM_ADVANCED. For some reason a graphics mode of ADVANCED triggers @@ -789,7 +789,7 @@ LRESULT CALLBACK TreeView::TreeWndProc(HWND window, // over we copy the right bits. SetViewportOrgEx(dc, 0, 0, NULL); } - canvas.endPlatformPaint(); + skia::EndPlatformPaint(&canvas); return 0; } |