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

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: Change CachingWordShaperTest as suggested Created 5 years, 5 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/DOMWindowProperty.h b/Source/platform/fonts/shaping/CachingWordShaper.h
similarity index 56%
copy from Source/core/frame/DOMWindowProperty.h
copy to Source/platform/fonts/shaping/CachingWordShaper.h
index 327c4694a99da036eb77694f983078e8efb8deb8..a8017d4f29f4d5a131042b21b266795a27081e1c 100644
--- a/Source/core/frame/DOMWindowProperty.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,44 +23,44 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DOMWindowProperty_h
-#define DOMWindowProperty_h
+#ifndef CachingWordShaper_h
+#define CachingWordShaper_h
-#include "core/CoreExport.h"
-#include "platform/heap/Handle.h"
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/text/TextRun.h"
+#include "wtf/PassRefPtr.h"
namespace blink {
-class LocalDOMWindow;
-class LocalFrame;
+class Font;
+class GlyphBuffer;
+class SimpleFontData;
+class ShapeCache;
+struct GlyphData;
-class CORE_EXPORT DOMWindowProperty : public WillBeGarbageCollectedMixin {
+class PLATFORM_EXPORT CachingWordShaper final {
public:
- explicit DOMWindowProperty(LocalFrame*);
-
- virtual void willDestroyGlobalObjectInFrame();
- virtual void willDetachGlobalObjectFromFrame();
-
- LocalFrame* frame() const { return m_frame; }
-
- EAGERLY_FINALIZE_WILL_BE_REMOVED();
- DECLARE_VIRTUAL_TRACE();
-
-protected:
- // TODO(Oilpan): when ~DOMWindowProperty is removed, check classes that derive
- // from it. Several will then be able to derive from GarbageCollected<> instead.
-#if !ENABLE(OILPAN)
- virtual ~DOMWindowProperty();
-#endif
+ CachingWordShaper();
+ ~CachingWordShaper();
+ void clear();
- RawPtrWillBeMember<LocalFrame> m_frame;
+ 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);
+ float fillGlyphBufferForTextEmphasis(const Font*, const TextRun&,
+ const GlyphData* emphasisData, GlyphBuffer*,
+ unsigned from, unsigned to);
+ FloatRect selectionRect(const Font*, const TextRun&, const FloatPoint&,
+ int height, unsigned from, unsigned to);
-#if !ENABLE(OILPAN)
private:
- LocalDOMWindow* m_associatedDOMWindow;
-#endif
+ ShapeCache* m_shapeCache;
};
} // namespace blink
-#endif // DOMWindowProperty_h
+#endif // CachingWordShaper_h
« no previous file with comments | « Source/platform/fonts/shaping/CachingWordShapeIterator.h ('k') | Source/platform/fonts/shaping/CachingWordShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698