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

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

Issue 2718043003: Refactor InspectorCSSAgent to avoid an intermediate GlyphBuffer (Closed)
Patch Set: review Created 3 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/CachingWordShaper.h
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h
index f3c42251d7c436bfcb90c147b3812d7092fdd16d..e403463a87a32874bb44179c72a7b32ca1265948 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h
@@ -30,14 +30,16 @@
#include "platform/text/TextRun.h"
#include "wtf/Allocator.h"
#include "wtf/PassRefPtr.h"
+#include "wtf/Vector.h"
+#include <tuple>
namespace blink {
struct CharacterRange;
class Font;
class GlyphBuffer;
-class SimpleFontData;
class ShapeCache;
+class SimpleFontData;
struct GlyphData;
class PLATFORM_EXPORT CachingWordShaper final {
@@ -45,36 +47,36 @@ class PLATFORM_EXPORT CachingWordShaper final {
WTF_MAKE_NONCOPYABLE(CachingWordShaper);
public:
- CachingWordShaper(ShapeCache* cache) : m_shapeCache(cache) {}
+ explicit CachingWordShaper(const Font&);
eae 2017/02/27 23:24:59 Now that all production code uses the new Font& co
f(malita) 2017/02/28 03:27:47 Done.
eae 2017/02/28 03:31:19 Thank you!
+ CachingWordShaper(const Font& font, ShapeCache* shapeCache)
+ : m_font(font), m_shapeCache(shapeCache) {}
~CachingWordShaper() {}
- float width(const Font*,
- const TextRun&,
+ float width(const TextRun&,
HashSet<const SimpleFontData*>* fallbackFonts,
FloatRect* glyphBounds);
- int offsetForPosition(const Font*,
- const TextRun&,
+ int offsetForPosition(const TextRun&,
float targetX,
bool includePartialGlyphs);
- float fillGlyphBuffer(const Font*,
- const TextRun&,
- HashSet<const SimpleFontData*>*,
+ float fillGlyphBuffer(const TextRun&,
GlyphBuffer*,
unsigned from,
unsigned to);
- float fillGlyphBufferForTextEmphasis(const Font*,
- const TextRun&,
+ float fillGlyphBufferForTextEmphasis(const TextRun&,
const GlyphData* emphasisData,
GlyphBuffer*,
unsigned from,
unsigned to);
- CharacterRange getCharacterRange(const Font*,
- const TextRun&,
+ CharacterRange getCharacterRange(const TextRun&,
unsigned from,
unsigned to);
- Vector<CharacterRange> individualCharacterRanges(const Font*, const TextRun&);
+ Vector<CharacterRange> individualCharacterRanges(const TextRun&);
+
+ Vector<std::tuple<SimpleFontData*, size_t>>
eae 2017/02/27 23:24:59 Please use a struct instead of a tuple here, as is
f(malita) 2017/02/28 03:27:47 Done.
+ getRunFontData(const TextRun&) const;
eae 2017/02/27 23:24:59 nit: How about fontDataForRun(TextRun) or even jus
f(malita) 2017/02/28 03:27:47 Done (fontData).
private:
+ const Font& m_font;
ShapeCache* m_shapeCache;
};

Powered by Google App Engine
This is Rietveld 408576698