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

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

Issue 1733193002: Move glyph lookup to hb-ot-font and remove glyph cache in HarfBuzzFace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
index 8e343ffd0d8244400ab1611568505b1e10c960ec..ff727ef843e446551ad2cca070055df2deb7486a 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
@@ -43,13 +43,38 @@
namespace blink {
+template<typename T>
+class HarfBuzzScopedPtr {
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(HarfBuzzScopedPtr);
+public:
+ typedef void (*DestroyFunction)(T*);
+
+ HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy)
+ : m_ptr(ptr)
+ , m_destroy(destroy)
+ {
+ ASSERT(m_destroy);
+ }
+ ~HarfBuzzScopedPtr()
+ {
+ if (m_ptr)
+ (*m_destroy)(m_ptr);
+ }
+
+ T* get() { return m_ptr; }
+ void set(T* ptr) { m_ptr = ptr; }
+private:
+ T* m_ptr;
+ DestroyFunction m_destroy;
+};
+
class FontPlatformData;
+struct HarfBuzzFontData;
class HarfBuzzFace : public RefCounted<HarfBuzzFace> {
WTF_MAKE_NONCOPYABLE(HarfBuzzFace);
public:
- static const hb_tag_t vertTag;
- static const hb_tag_t vrt2Tag;
static PassRefPtr<HarfBuzzFace> create(FontPlatformData* platformData, uint64_t uniqueID)
{
@@ -67,11 +92,13 @@ private:
HarfBuzzFace(FontPlatformData*, uint64_t);
hb_face_t* createFace();
+ void prepareHarfBuzzFontData();
FontPlatformData* m_platformData;
uint64_t m_uniqueID;
hb_face_t* m_face;
- WTF::HashMap<uint32_t, uint16_t>* m_glyphCacheForFaceCacheEntry;
+ hb_font_t* m_unscaledFont;
+ OwnPtr<HarfBuzzFontData> m_harfBuzzFontData;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698