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

Side by Side Diff: src/ports/SkFontHost_win.cpp

Issue 13637004: Fix font handles leak. We return without freeing resources. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) { 1379 (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) {
1380 info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font; 1380 info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font;
1381 } else { 1381 } else {
1382 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; 1382 info->fType = SkAdvancedTypefaceMetrics::kOther_Font;
1383 info->fItalicAngle = 0; 1383 info->fItalicAngle = 0;
1384 info->fAscent = 0; 1384 info->fAscent = 0;
1385 info->fDescent = 0; 1385 info->fDescent = 0;
1386 info->fStemV = 0; 1386 info->fStemV = 0;
1387 info->fCapHeight = 0; 1387 info->fCapHeight = 0;
1388 info->fBBox = SkIRect::MakeEmpty(); 1388 info->fBBox = SkIRect::MakeEmpty();
1389 return info; 1389 goto ReturnInfo;
1390 } 1390 }
1391 1391
1392 // If this bit is clear the font is a fixed pitch font. 1392 // If this bit is clear the font is a fixed pitch font.
1393 if (!(otm.otmTextMetrics.tmPitchAndFamily & TMPF_FIXED_PITCH)) { 1393 if (!(otm.otmTextMetrics.tmPitchAndFamily & TMPF_FIXED_PITCH)) {
1394 info->fStyle |= SkAdvancedTypefaceMetrics::kFixedPitch_Style; 1394 info->fStyle |= SkAdvancedTypefaceMetrics::kFixedPitch_Style;
1395 } 1395 }
1396 if (otm.otmTextMetrics.tmItalic) { 1396 if (otm.otmTextMetrics.tmItalic) {
1397 info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; 1397 info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style;
1398 } 1398 }
1399 if (otm.otmTextMetrics.tmPitchAndFamily & FF_ROMAN) { 1399 if (otm.otmTextMetrics.tmPitchAndFamily & FF_ROMAN) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 } else { 1445 } else {
1446 info->fGlyphWidths.reset( 1446 info->fGlyphWidths.reset(
1447 getAdvanceData(hdc, 1447 getAdvanceData(hdc,
1448 glyphCount, 1448 glyphCount,
1449 glyphIDs, 1449 glyphIDs,
1450 glyphIDsCount, 1450 glyphIDsCount,
1451 &getWidthAdvance)); 1451 &getWidthAdvance));
1452 } 1452 }
1453 } 1453 }
1454 1454
1455 Error: 1455 Error:
Vitaly Buka (NO REVIEWS) 2013/04/06 19:33:43 Why not just rename Error: -> Exit: or Return:
edisonn 2013/04/08 15:09:43 this message was lost somehow: I prefer ReturnInfo
1456 ReturnInfo:
1456 SelectObject(hdc, savefont); 1457 SelectObject(hdc, savefont);
1457 DeleteObject(designFont); 1458 DeleteObject(designFont);
1458 DeleteObject(font); 1459 DeleteObject(font);
1459 DeleteDC(hdc); 1460 DeleteDC(hdc);
1460 1461
1461 return info; 1462 return info;
1462 } 1463 }
1463 1464
1464 //Dummy representation of a Base64 encoded GUID from create_unique_font_name. 1465 //Dummy representation of a Base64 encoded GUID from create_unique_font_name.
1465 #define BASE64_GUID_ID "XXXXXXXXXXXXXXXXXXXXXXXX" 1466 #define BASE64_GUID_ID "XXXXXXXXXXXXXXXXXXXXXXXX"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 } 1677 }
1677 1678
1678 /////////////////////////////////////////////////////////////////////////////// 1679 ///////////////////////////////////////////////////////////////////////////////
1679 1680
1680 #include "SkFontMgr.h" 1681 #include "SkFontMgr.h"
1681 1682
1682 SkFontMgr* SkFontMgr::Factory() { 1683 SkFontMgr* SkFontMgr::Factory() {
1683 // todo 1684 // todo
1684 return NULL; 1685 return NULL;
1685 } 1686 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698