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

Side by Side Diff: core/fxge/ge/cttfontdesc.cpp

Issue 2292503002: Refactor fx_font part 4 (Closed)
Patch Set: Comments Created 4 years, 3 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
« no previous file with comments | « core/fxge/ge/cttfontdesc.h ('k') | core/fxge/ge/fx_ge_font.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "core/fxge/ge/cttfontdesc.h"
8
9 #include "core/fxge/include/fx_freetype.h"
10
11 CTTFontDesc::~CTTFontDesc() {
12 if (m_Type == 1) {
13 if (m_SingleFace.m_pFace)
14 FXFT_Done_Face(m_SingleFace.m_pFace);
15 } else if (m_Type == 2) {
16 for (int i = 0; i < 16; i++) {
17 if (m_TTCFace.m_pFaces[i])
18 FXFT_Done_Face(m_TTCFace.m_pFaces[i]);
19 }
20 }
21 FX_Free(m_pFontData);
22 }
23
24 int CTTFontDesc::ReleaseFace(FXFT_Face face) {
25 if (m_Type == 1) {
26 if (m_SingleFace.m_pFace != face)
27 return -1;
28 } else if (m_Type == 2) {
29 int i;
30 for (i = 0; i < 16; i++) {
31 if (m_TTCFace.m_pFaces[i] == face)
32 break;
33 }
34 if (i == 16)
35 return -1;
36 }
37 m_RefCount--;
38 if (m_RefCount)
39 return m_RefCount;
40 delete this;
41 return 0;
42 }
OLDNEW
« no previous file with comments | « core/fxge/ge/cttfontdesc.h ('k') | core/fxge/ge/fx_ge_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698