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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698