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

Side by Side Diff: src/core/SkTypeface.cpp

Issue 488143002: Replace SkTypeface::Style with SkFontStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add expectations, remove whitespace. Created 6 years, 2 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 | « src/core/SkFontHost.cpp ('k') | src/core/SkTypefaceCache.h » ('j') | 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 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkEndian.h" 9 #include "SkEndian.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
11 #include "SkFontMgr.h" 11 #include "SkFontMgr.h"
12 #include "SkLazyPtr.h" 12 #include "SkLazyPtr.h"
13 #include "SkOTTable_OS_2.h" 13 #include "SkOTTable_OS_2.h"
14 #include "SkStream.h" 14 #include "SkStream.h"
15 #include "SkTypeface.h" 15 #include "SkTypeface.h"
16 16
17 //#define TRACE_LIFECYCLE 17 SkTypeface::SkTypeface(const SkFontStyle& style, SkFontID fontID, bool isFixedPi tch)
18 : fUniqueID(fontID), fStyle(style), fIsFixedPitch(isFixedPitch) { }
18 19
19 #ifdef TRACE_LIFECYCLE 20 SkTypeface::~SkTypeface() { }
20 static int32_t gTypefaceCounter;
21 #endif
22
23 SkTypeface::SkTypeface(Style style, SkFontID fontID, bool isFixedPitch)
24 : fUniqueID(fontID), fStyle(style), fIsFixedPitch(isFixedPitch) {
25 #ifdef TRACE_LIFECYCLE
26 SkDebugf("SkTypeface: create %p fontID %d total %d\n",
27 this, fontID, ++gTypefaceCounter);
28 #endif
29 }
30
31 SkTypeface::~SkTypeface() {
32 #ifdef TRACE_LIFECYCLE
33 SkDebugf("SkTypeface: destroy %p fontID %d total %d\n",
34 this, fUniqueID, --gTypefaceCounter);
35 #endif
36 }
37 21
38 /////////////////////////////////////////////////////////////////////////////// 22 ///////////////////////////////////////////////////////////////////////////////
39 23
40 class SkEmptyTypeface : public SkTypeface { 24 class SkEmptyTypeface : public SkTypeface {
41 public: 25 public:
42 static SkEmptyTypeface* Create() { 26 static SkEmptyTypeface* Create() {
43 return SkNEW(SkEmptyTypeface); 27 return SkNEW(SkEmptyTypeface);
44 } 28 }
45 protected: 29 protected:
46 SkEmptyTypeface() : SkTypeface(SkTypeface::kNormal, 0, true) { } 30 SkEmptyTypeface() : SkTypeface(SkFontStyle(), 0, true) { }
47 31
48 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { return NUL L; } 32 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { return NUL L; }
49 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK _OVERRIDE { 33 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK _OVERRIDE {
50 return NULL; 34 return NULL;
51 } 35 }
52 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE { } 36 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE { }
53 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( 37 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
54 SkAdvancedTypefaceMetrics::PerGlyphInfo, 38 SkAdvancedTypefaceMetrics::PerGlyphInfo,
55 const uint32_t*, uint32_t) const SK_OVERRIDE { r eturn NULL; } 39 const uint32_t*, uint32_t) const SK_OVERRIDE { r eturn NULL; }
56 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE { } 40 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE { }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 277 }
294 return result; 278 return result;
295 } 279 }
296 280
297 /////////////////////////////////////////////////////////////////////////////// 281 ///////////////////////////////////////////////////////////////////////////////
298 282
299 bool SkTypeface::onGetKerningPairAdjustments(const uint16_t glyphs[], int count, 283 bool SkTypeface::onGetKerningPairAdjustments(const uint16_t glyphs[], int count,
300 int32_t adjustments[]) const { 284 int32_t adjustments[]) const {
301 return false; 285 return false;
302 } 286 }
OLDNEW
« no previous file with comments | « src/core/SkFontHost.cpp ('k') | src/core/SkTypefaceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698