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

Unified Diff: Source/platform/fonts/shaping/CachingWordShaper.h

Issue 1192223002: Optimize Complex Text Shaping and Caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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: Source/platform/fonts/shaping/CachingWordShaper.h
diff --git a/Source/core/frame/LocalFrameLifecycleObserver.h b/Source/platform/fonts/shaping/CachingWordShaper.h
similarity index 62%
copy from Source/core/frame/LocalFrameLifecycleObserver.h
copy to Source/platform/fonts/shaping/CachingWordShaper.h
index b7109cee619ba5857846d64f60a72ec4af4b0f94..b0ea74d9cc2ca58abb3afcdd35df07a7bd18abaa 100644
--- a/Source/core/frame/LocalFrameLifecycleObserver.h
+++ b/Source/platform/fonts/shaping/CachingWordShaper.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google, Inc. All Rights Reserved.
+ * Copyright (C) 2015 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,36 +23,39 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LocalFrameLifecycleObserver_h
-#define LocalFrameLifecycleObserver_h
+#ifndef CachingWordShaper_h
+#define CachingWordShaper_h
-#include "core/CoreExport.h"
-#include "core/frame/LocalFrame.h"
-#include "platform/LifecycleObserver.h"
-#include "platform/heap/Handle.h"
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/text/TextRun.h"
+#include "wtf/PassRefPtr.h"
namespace blink {
-class LocalFrame;
-class LocalFrameLifecycleNotifier;
+class Font;
+class GlyphBuffer;
+class SimpleFontData;
+class ShapeCache;
+struct GlyphData;
-class CORE_EXPORT LocalFrameLifecycleObserver : public LifecycleObserver<LocalFrame, LocalFrameLifecycleObserver, LocalFrameLifecycleNotifier> {
+class PLATFORM_EXPORT CachingWordShaper final {
public:
- virtual void willDetachFrameHost() { }
- virtual void contextDestroyed()
- {
- setContext(nullptr);
- }
-
- LocalFrame* frame() const { return lifecycleContext(); }
-
-protected:
- explicit LocalFrameLifecycleObserver(LocalFrame* frame)
- : LifecycleObserver(frame)
- {
- }
+ CachingWordShaper();
+ ~CachingWordShaper();
+ void clear();
+
+ float width(const Font*, const TextRun&,
+ HashSet<const SimpleFontData*>* fallbackFonts,
+ FloatRect* glyphBounds);
+ float fillGlyphBuffer(const Font*, const TextRun&,
+ HashSet<const SimpleFontData*>*, GlyphBuffer*,
+ unsigned from, unsigned to);
+
+ private:
+ ShapeCache* m_shapeCache;
};
} // namespace blink
-#endif // LocalFrameLifecycleObserver_h
+#endif // CachingWordShaper_h

Powered by Google App Engine
This is Rietveld 408576698