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

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

Issue 2718043003: Refactor InspectorCSSAgent to avoid an intermediate GlyphBuffer (Closed)
Patch Set: cleanup 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..bf17fa12ab0686bbc85dc15521bcde3c18a3aa1b 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h
@@ -26,18 +26,21 @@
#ifndef CachingWordShaper_h
#define CachingWordShaper_h
+#include "platform/fonts/shaping/ShapeResultBuffer.h"
#include "platform/geometry/FloatRect.h"
#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,37 +48,35 @@ class PLATFORM_EXPORT CachingWordShaper final {
WTF_MAKE_NONCOPYABLE(CachingWordShaper);
public:
- CachingWordShaper(ShapeCache* cache) : m_shapeCache(cache) {}
+ explicit CachingWordShaper(const Font& font) : m_font(font) {}
~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<ShapeResultBuffer::RunFontData> runFontData(const TextRun&) const;
private:
- ShapeCache* m_shapeCache;
+ ShapeCache* shapeCache() const;
+
+ const Font& m_font;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698