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

Unified Diff: ui/gfx/canvas_mac.mm

Issue 11299262: ui: Use skia::RefPtr<T> for implicit safe reference counting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: winbuild Created 8 years 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 | « ui/gfx/canvas.cc ('k') | ui/gfx/platform_font_pango.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_mac.mm
diff --git a/ui/gfx/canvas_mac.mm b/ui/gfx/canvas_mac.mm
index 2b8f39e6d21f6c386ccba5f9e4fe88ca5b4822a8..0a597a52d0810166d3b802595cd0657b2b743618 100644
--- a/ui/gfx/canvas_mac.mm
+++ b/ui/gfx/canvas_mac.mm
@@ -59,11 +59,11 @@ void Canvas::DrawStringWithShadows(const string16& text,
const ShadowValues& shadows) {
DLOG_IF(WARNING, !shadows.empty()) << "Text shadow not implemented.";
- SkTypeface* typeface = SkTypeface::CreateFromName(font.GetFontName().c_str(),
- FontTypefaceStyle(font));
+ skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(
+ SkTypeface::CreateFromName(
+ font.GetFontName().c_str(), FontTypefaceStyle(font)));
SkPaint paint;
- paint.setTypeface(typeface);
- typeface->unref();
+ paint.setTypeface(typeface.get());
paint.setColor(color);
canvas_->drawText(text.c_str(),
text.size() * sizeof(string16::value_type),
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/gfx/platform_font_pango.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698