Changeset 206383 in webkit
- Timestamp:
- Sep 26, 2016 11:57:21 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206381 r206383 1 2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 Add CairoUniquePtr and use it in FontPlatformDataFreetype.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=162557 5 6 Reviewed by Alex Christensen. 7 8 * platform/graphics/cairo/CairoUniquePtr.h: Added. 9 (WebCore::CairoPtrDeleter<cairo_font_options_t>::operator()): 10 * platform/graphics/freetype/FontPlatformDataFreeType.cpp: 11 (WebCore::getDefaultCairoFontOptions): Return a smart pointer. 12 (WebCore::FontPlatformData::buildScaledFont): Use smart pointer. 13 1 14 2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com> 2 15 -
trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp
r206373 r206383 26 26 #include "FontPlatformData.h" 27 27 28 #include "CairoUniquePtr.h" 28 29 #include "CairoUtilities.h" 29 30 #include "FontCache.h" … … 106 107 } 107 108 108 static cairo_font_options_t*getDefaultCairoFontOptions()109 static CairoUniquePtr<cairo_font_options_t> getDefaultCairoFontOptions() 109 110 { 110 111 #if PLATFORM(GTK) … … 112 113 const cairo_font_options_t* screenOptions = gdk_screen_get_font_options(screen); 113 114 if (screenOptions) 114 return cairo_font_options_copy(screenOptions);115 return CairoUniquePtr<cairo_font_options_t>(cairo_font_options_copy(screenOptions)); 115 116 } 116 117 #endif 117 return cairo_font_options_create();118 return CairoUniquePtr<cairo_font_options_t>(cairo_font_options_create()); 118 119 } 119 120 … … 300 301 void FontPlatformData::buildScaledFont(cairo_font_face_t* fontFace) 301 302 { 302 cairo_font_options_t*options = getDefaultCairoFontOptions();303 CairoUniquePtr<cairo_font_options_t> options = getDefaultCairoFontOptions(); 303 304 FcPattern* optionsPattern = m_pattern ? m_pattern.get() : getDefaultFontconfigOptions(); 304 setCairoFontOptionsFromFontConfigPattern(options , optionsPattern);305 setCairoFontOptionsFromFontConfigPattern(options.get(), optionsPattern); 305 306 306 307 cairo_matrix_t ctm; … … 341 342 } 342 343 343 m_scaledFont = adoptRef(cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options)); 344 cairo_font_options_destroy(options); 344 m_scaledFont = adoptRef(cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options.get())); 345 345 } 346 346
Note: See TracChangeset
for help on using the changeset viewer.