diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-05 01:00:54 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-05 01:00:54 +0000 |
commit | 3699ae5a17c4b0b68842a673550d86cdc7961728 (patch) | |
tree | cf60fc865bcbdf60e47ca37b43fa7cfd5898f01f /ui/gfx/platform_font_pango.h | |
parent | f775d10814adf1320c8bf9de8279d473c254dd9e (diff) | |
download | chromium_src-3699ae5a17c4b0b68842a673550d86cdc7961728.zip chromium_src-3699ae5a17c4b0b68842a673550d86cdc7961728.tar.gz chromium_src-3699ae5a17c4b0b68842a673550d86cdc7961728.tar.bz2 |
ui: Use skia::RefPtr<T> for implicit safe reference counting.
R=sky
BUG=163454
Depends on: https://codereview.chromium.org/11418217/
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11299262
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/platform_font_pango.h')
-rw-r--r-- | ui/gfx/platform_font_pango.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ui/gfx/platform_font_pango.h b/ui/gfx/platform_font_pango.h index cb93bf4..845c150 100644 --- a/ui/gfx/platform_font_pango.h +++ b/ui/gfx/platform_font_pango.h @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" +#include "skia/ext/refptr.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "ui/gfx/platform_font.h" @@ -52,7 +53,7 @@ class UI_EXPORT PlatformFontPango : public PlatformFont { private: // Create a new instance of this object with the specified properties. Called // from DeriveFont. - PlatformFontPango(SkTypeface* typeface, + PlatformFontPango(const skia::RefPtr<SkTypeface>& typeface, const std::string& name, int size, int style); @@ -60,10 +61,11 @@ class UI_EXPORT PlatformFontPango : public PlatformFont { // Initialize this object. void InitWithNameAndSize(const std::string& font_name, int font_size); - void InitWithTypefaceNameSizeAndStyle(SkTypeface* typeface, - const std::string& name, - int size, - int style); + void InitWithTypefaceNameSizeAndStyle( + const skia::RefPtr<SkTypeface>& typeface, + const std::string& name, + int size, + int style); void InitFromPlatformFont(const PlatformFontPango* other); // Potentially slow call to get pango metrics (average width, underline info). @@ -78,11 +80,7 @@ class UI_EXPORT PlatformFontPango : public PlatformFont { // The average width of a character, initialized and cached if needed. double GetAverageWidth() const; - // These two both point to the same SkTypeface. We use the SkAutoUnref to - // handle the reference counting, but without @typeface_ we would have to - // cast the SkRefCnt from @typeface_helper_ every time. - scoped_ptr<SkAutoUnref> typeface_helper_; - SkTypeface* typeface_; + skia::RefPtr<SkTypeface> typeface_; // Additional information about the face // Skia actually expects a family name and not a font name. |