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

Unified Diff: webkit/plugins/ppapi/ppb_flash_impl.cc

Issue 11428099: Use skia::RefPtr in place of manual ref-counting for Skia types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_flash_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_flash_impl.cc b/webkit/plugins/ppapi/ppb_flash_impl.cc
index 64aa79794df0bb4119dfa413bd85cfecc9774092..df6eb2253134c7e34a64af7cf0c28583191338cd 100644
--- a/webkit/plugins/ppapi/ppb_flash_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_impl.cc
@@ -94,12 +94,11 @@ PP_Bool PPB_Flash_Impl::DrawGlyphs(PP_Instance instance,
style |= SkTypeface::kBold;
if (font_desc->italic)
style |= SkTypeface::kItalic;
- SkTypeface* typeface =
+ skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(
SkTypeface::CreateFromName(face_name->value().c_str(),
- static_cast<SkTypeface::Style>(style));
+ static_cast<SkTypeface::Style>(style)));
if (!typeface)
return PP_FALSE;
- SkAutoUnref aur(typeface);
// Set up the canvas.
SkCanvas* canvas = image_resource->GetPlatformCanvas();
@@ -131,7 +130,7 @@ PP_Bool PPB_Flash_Impl::DrawGlyphs(PP_Instance instance,
paint.setAntiAlias(true);
paint.setHinting(SkPaint::kFull_Hinting);
paint.setTextSize(SkIntToScalar(font_desc->size));
- paint.setTypeface(typeface); // Takes a ref and manages lifetime.
+ paint.setTypeface(typeface.get()); // Takes a ref and manages lifetime.
if (allow_subpixel_aa) {
paint.setSubpixelText(true);
paint.setLCDRenderText(true);
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698