| Index: chrome/browser/autocomplete/autocomplete_edit_view_win.cc
|
| ===================================================================
|
| --- chrome/browser/autocomplete/autocomplete_edit_view_win.cc (revision 82144)
|
| +++ chrome/browser/autocomplete/autocomplete_edit_view_win.cc (working copy)
|
| @@ -2292,8 +2292,9 @@
|
| // Create a canvas as large as |scheme_rect| to do our drawing, and initialize
|
| // it to fully transparent so any antialiasing will look nice when painted
|
| // atop the edit.
|
| - gfx::CanvasSkia canvas(scheme_rect.Width(), scheme_rect.Height(), false);
|
| - canvas.getDevice()->accessBitmap(true).eraseARGB(0, 0, 0, 0);
|
| + gfx::CanvasSkia canvas;
|
| + canvas.Init(scheme_rect.Width(), scheme_rect.Height(), false);
|
| + canvas.skia_canvas()->getDevice()->accessBitmap(true).eraseARGB(0, 0, 0, 0);
|
|
|
| // Calculate the start and end of the stroke, which are just the lower left
|
| // and upper right corners of the canvas, inset by the radius of the endcap
|
| @@ -2317,29 +2318,33 @@
|
| SkIntToScalar(scheme_rect.Height()) };
|
|
|
| // Draw the unselected portion of the stroke.
|
| - canvas.save();
|
| + canvas.Save();
|
| if (selection_rect.isEmpty() ||
|
| - canvas.clipRect(selection_rect, SkRegion::kDifference_Op)) {
|
| + canvas.skia_canvas()->clipRect(selection_rect,
|
| + SkRegion::kDifference_Op)) {
|
| paint.setColor(LocationBarView::GetColor(security_level_,
|
| LocationBarView::SECURITY_TEXT));
|
| - canvas.drawLine(start_point.fX, start_point.fY,
|
| - end_point.fX, end_point.fY, paint);
|
| + canvas.skia_canvas()->drawLine(
|
| + start_point.fX, start_point.fY, end_point.fX, end_point.fY, paint);
|
| }
|
| - canvas.restore();
|
| + canvas.Restore();
|
|
|
| // Draw the selected portion of the stroke.
|
| - if (!selection_rect.isEmpty() && canvas.clipRect(selection_rect)) {
|
| + if (!selection_rect.isEmpty() &&
|
| + canvas.skia_canvas()->clipRect(selection_rect)) {
|
| paint.setColor(LocationBarView::GetColor(security_level_,
|
| LocationBarView::SELECTED_TEXT));
|
| - canvas.drawLine(start_point.fX, start_point.fY,
|
| - end_point.fX, end_point.fY, paint);
|
| + canvas.skia_canvas()->drawLine(
|
| + start_point.fX, start_point.fY, end_point.fX, end_point.fY, paint);
|
| }
|
|
|
| // Now copy what we drew to the target HDC.
|
| - canvas.getTopPlatformDevice().drawToHDC(hdc,
|
| + gfx::Point dst_origin(
|
| scheme_rect.left + canvas_paint_clip_rect.left - canvas_clip_rect.left,
|
| - std::max(scheme_rect.top, client_rect.top) + canvas_paint_clip_rect.top -
|
| - canvas_clip_rect.top, &canvas_paint_clip_rect);
|
| + std::max(scheme_rect.top, client_rect.top) +
|
| + canvas_paint_clip_rect.top - canvas_clip_rect.top);
|
| + canvas.BlitToNativeContext(gfx::Rect(canvas_paint_clip_rect),
|
| + dst_origin, hdc);
|
| }
|
|
|
| void AutocompleteEditViewWin::DrawDropHighlight(HDC hdc,
|
|
|