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

Unified Diff: ui/gfx/render_text_win.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 years, 2 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
Index: ui/gfx/render_text_win.cc
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index f6b983da75b50b8d4359993e6ec3bd8a3d1fd88e..114a9632cab78994b6eab83e4ad12c3600c090c6 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -100,7 +100,7 @@ int RenderTextWin::GetStringWidth() {
}
void RenderTextWin::Draw(Canvas* canvas) {
- skia::ScopedPlatformPaint scoped_platform_paint(canvas->AsCanvasSkia());
+ skia::ScopedPlatformPaint scoped_platform_paint(canvas->GetSkCanvas());
HDC hdc = scoped_platform_paint.GetPlatformSurface();
int saved_dc = SaveDC(hdc);
DrawSelection(canvas);
@@ -590,7 +590,7 @@ void RenderTextWin::DrawVisualText(Canvas* canvas) {
if (text().empty())
return;
- CanvasSkia* canvas_skia = canvas->AsCanvasSkia();
+ SkCanvas* canvas_skia = canvas->GetSkCanvas();
skia::ScopedPlatformPaint scoped_platform_paint(canvas_skia);
Point offset(ToViewPoint(Point()));
@@ -645,11 +645,11 @@ void RenderTextWin::DrawVisualText(Canvas* canvas) {
strike.setStyle(SkPaint::kFill_Style);
strike.setColor(run->foreground);
strike.setStrokeWidth(kStrikeWidth);
- canvas->AsCanvasSkia()->drawLine(SkIntToScalar(bounds.x()),
- SkIntToScalar(bounds.bottom()),
- SkIntToScalar(bounds.right()),
- SkIntToScalar(bounds.y()),
- strike);
+ canvas->GetSkCanvas()->drawLine(SkIntToScalar(bounds.x()),
+ SkIntToScalar(bounds.bottom()),
+ SkIntToScalar(bounds.right()),
+ SkIntToScalar(bounds.y()),
+ strike);
}
offset.Offset(run->width, 0);
}

Powered by Google App Engine
This is Rietveld 408576698