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

Unified Diff: ui/gfx/canvas_skia_linux.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressing comments. Created 9 years, 7 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/canvas_skia_linux.cc
===================================================================
--- ui/gfx/canvas_skia_linux.cc (revision 85672)
+++ ui/gfx/canvas_skia_linux.cc (working copy)
@@ -208,7 +208,7 @@
text_height_(0) {
DCHECK(!bounds_.IsEmpty());
- cr_ = canvas_->beginPlatformPaint();
+ cr_ = skia::BeginPlatformPaint(canvas_);
layout_ = pango_cairo_create_layout(cr_);
SetupPangoLayout(layout_, text, font, bounds_.width(), flags_);
@@ -247,7 +247,7 @@
cairo_restore(cr_);
g_object_unref(layout_);
- // NOTE: beginPlatformPaint returned its surface, we shouldn't destroy it.
+ // NOTE: BeginPlatformPaint returned its surface, we shouldn't destroy it.
}
void DrawStringContext::Draw(const SkColor& text_color) {
@@ -266,7 +266,7 @@
text_canvas.FillRectInt(static_cast<SkColor>(0),
0, 0, bounds_.width() + 2, bounds_.height() + 2);
- cairo_t* text_cr = text_canvas.beginPlatformPaint();
+ cairo_t* text_cr = skia::BeginPlatformPaint(&text_canvas);
cairo_move_to(text_cr, 2, 1);
pango_cairo_layout_path(text_cr, layout_);
@@ -288,10 +288,10 @@
SkColorGetA(text_color) / 255.0);
cairo_fill(text_cr);
- text_canvas.endPlatformPaint();
+ skia::EndPlatformPaint(&text_canvas);
const SkBitmap& text_bitmap = const_cast<SkBitmap&>(
- text_canvas.getTopPlatformDevice().accessBitmap(false));
+ text_canvas.getTopDevice().accessBitmap(false));
canvas_->DrawBitmapInt(text_bitmap, text_x_ - 1, text_y_ - 1);
}
@@ -379,7 +379,7 @@
return;
}
- cairo_t* cr = beginPlatformPaint();
+ cairo_t* cr = skia::BeginPlatformPaint(this);
gdk_cairo_set_source_pixbuf(cr, pixbuf, x, y);
cairo_paint(cr);
}

Powered by Google App Engine
This is Rietveld 408576698