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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h

Issue 1931393002: Introduce typeface cache in blink::FontCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip: others Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include "wtf/PassRefPtr.h" 38 #include "wtf/PassRefPtr.h"
39 #include "wtf/RefCounted.h" 39 #include "wtf/RefCounted.h"
40 #include "wtf/RefPtr.h" 40 #include "wtf/RefPtr.h"
41 #include "wtf/text/CharacterNames.h" 41 #include "wtf/text/CharacterNames.h"
42 42
43 #include <hb.h> 43 #include <hb.h>
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class FontPlatformData; 47 class FontPlatformData;
48 struct FontRenderStyle;
48 49
49 class HarfBuzzFace : public RefCounted<HarfBuzzFace> { 50 class HarfBuzzFace : public RefCounted<HarfBuzzFace> {
50 WTF_MAKE_NONCOPYABLE(HarfBuzzFace); 51 WTF_MAKE_NONCOPYABLE(HarfBuzzFace);
51 public: 52 public:
52 static const hb_tag_t vertTag; 53 static const hb_tag_t vertTag;
53 static const hb_tag_t vrt2Tag; 54 static const hb_tag_t vrt2Tag;
54 55
55 static PassRefPtr<HarfBuzzFace> create(FontPlatformData* platformData, uint6 4_t uniqueID) 56 static PassRefPtr<HarfBuzzFace> create(FontPlatformData* platformData, uint6 4_t uniqueID)
56 { 57 {
57 return adoptRef(new HarfBuzzFace(platformData, uniqueID)); 58 return adoptRef(new HarfBuzzFace(platformData, uniqueID));
58 } 59 }
59 ~HarfBuzzFace(); 60 ~HarfBuzzFace();
60 61
61 // In order to support the restricting effect of unicode-range optionally a 62 // In order to support the restricting effect of unicode-range optionally a
62 // range restriction can be passed in, which will restrict which glyphs we 63 // range restriction can be passed in, which will restrict which glyphs we
63 // return in the harfBuzzGetGlyph function. 64 // return in the harfBuzzGetGlyph function.
64 hb_font_t* createFont(PassRefPtr<UnicodeRangeSet> = nullptr) const; 65 hb_font_t* createFont(float size, const FontRenderStyle&, PassRefPtr<Unicode RangeSet> = nullptr) const;
65 hb_face_t* face() const { return m_face; } 66 hb_face_t* face() const { return m_face; }
66 67
67 private: 68 private:
68 HarfBuzzFace(FontPlatformData*, uint64_t); 69 HarfBuzzFace(FontPlatformData*, uint64_t);
69 70
70 hb_face_t* createFace(); 71 hb_face_t* createFace();
71 72
72 FontPlatformData* m_platformData; 73 FontPlatformData* m_platformData;
73 uint64_t m_uniqueID; 74 uint64_t m_uniqueID;
74 hb_face_t* m_face; 75 hb_face_t* m_face;
(...skipping 10 matching lines...) Expand all
85 static void deletePtr(hb_font_t* font) 86 static void deletePtr(hb_font_t* font)
86 { 87 {
87 if (font) 88 if (font)
88 hb_font_destroy(font); 89 hb_font_destroy(font);
89 } 90 }
90 }; 91 };
91 92
92 } // namespace WTF 93 } // namespace WTF
93 94
94 #endif // HarfBuzzFace_h 95 #endif // HarfBuzzFace_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698