Index: chrome/browser/renderer_host/render_widget_host_view_win.cc |
=================================================================== |
--- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 82144) |
+++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy) |
@@ -164,8 +164,9 @@ |
const gfx::Rect& paint_rect, |
HDC backing_store_dc, |
HDC paint_dc) { |
- gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true); |
- HDC dc = canvas.beginPlatformPaint(); |
+ gfx::CanvasSkia canvas; |
+ canvas.Init(paint_rect.width(), paint_rect.height(), true); |
+ HDC dc = canvas.BeginPlatformPaint(); |
BitBlt(dc, |
0, |
0, |
@@ -175,10 +176,10 @@ |
paint_rect.x(), |
paint_rect.y(), |
SRCCOPY); |
- canvas.endPlatformPaint(); |
+ canvas.EndPlatformPaint(); |
canvas.FillRectInt(color, 0, 0, paint_rect.width(), paint_rect.height()); |
- canvas.getTopPlatformDevice().drawToHDC(paint_dc, paint_rect.x(), |
- paint_rect.y(), NULL); |
+ canvas.BlitToNativeContext(gfx::Rect(paint_rect.size()), |
+ paint_rect.origin(), paint_dc); |
} |
// The plugin wrapper window which lives in the browser process has this proc |
@@ -946,9 +947,10 @@ |
void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, |
CPaintDC* dc) { |
if (!background_.empty()) { |
- gfx::CanvasSkia canvas(dirty_rect.right - dirty_rect.left, |
- dirty_rect.bottom - dirty_rect.top, |
- true); // opaque |
+ gfx::CanvasSkia canvas; |
+ int width = dirty_rect.right - dirty_rect.left; |
+ int height = dirty_rect.bottom - dirty_rect.top; |
+ canvas.Init(width, height, true); // opaque |
canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top); |
const RECT& dc_rect = dc->m_ps.rcPaint; |
@@ -956,8 +958,8 @@ |
dc_rect.right - dc_rect.left, |
dc_rect.bottom - dc_rect.top); |
- canvas.getTopPlatformDevice().drawToHDC(*dc, dirty_rect.left, |
- dirty_rect.top, NULL); |
+ canvas.BlitToNativeContext(gfx::Rect(width, height), |
+ gfx::Point(dirty_rect.left, dirty_rect.top), *dc); |
} else { |
HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
dc->FillRect(&dirty_rect, white_brush); |