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

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

Issue 1088093005: Unit tests for HarfBuzzShaper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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/HarfBuzzShaper.h
diff --git a/Source/platform/fonts/shaping/HarfBuzzShaper.h b/Source/platform/fonts/shaping/HarfBuzzShaper.h
index 405c5951d082dfcbacc90a342a390a7c7fac9f7a..1ded6875b93e8714dc49b962d10aab0593579a3c 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaper.h
+++ b/Source/platform/fonts/shaping/HarfBuzzShaper.h
@@ -50,7 +50,7 @@ class Font;
class GlyphBuffer;
class SimpleFontData;
-class HarfBuzzShaper final : public Shaper {
+class PLATFORM_EXPORT HarfBuzzShaper final : public Shaper {
public:
HarfBuzzShaper(const Font*, const TextRun&, const GlyphData* emphasisData = nullptr,
HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nullptr);
@@ -61,6 +61,23 @@ public:
int offsetForPosition(float targetX);
FloatRect selectionRect(const FloatPoint&, int height, int from, int to);
+ unsigned numberOfRunsForTesting() const
+ {
+ return m_harfBuzzRuns.size();
+ }
+
+ bool runInfoForTesting(unsigned runIndex, unsigned& startIndex,
Dominik Röttsches 2015/04/22 14:17:51 You preferred reference parameters here - I was wo
+ unsigned& numGlyphs, hb_script_t& script)
+ {
+ if (runIndex < m_harfBuzzRuns.size()) {
+ startIndex = m_harfBuzzRuns[runIndex]->startIndex();
+ numGlyphs = m_harfBuzzRuns[runIndex]->numGlyphs();
+ script = m_harfBuzzRuns[runIndex]->script();
+ return true;
+ }
+ return false;
+ }
+
private:
class HarfBuzzRun {
public:

Powered by Google App Engine
This is Rietveld 408576698