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

Unified Diff: Source/core/layout/svg/SVGTextChunkBuilder.h

Issue 1155293005: Perform SVG text chunk processing on-the-fly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/core/layout/svg/SVGTextChunkBuilder.h
diff --git a/Source/core/layout/svg/SVGTextChunkBuilder.h b/Source/core/layout/svg/SVGTextChunkBuilder.h
index 99808a8f3e043a17a656a49b574359de66a0a4d0..8df60862dd6876ea5acd8c2156b699bfa4b1250e 100644
--- a/Source/core/layout/svg/SVGTextChunkBuilder.h
+++ b/Source/core/layout/svg/SVGTextChunkBuilder.h
@@ -20,7 +20,6 @@
#ifndef SVGTextChunkBuilder_h
#define SVGTextChunkBuilder_h
-#include "core/layout/svg/SVGTextChunk.h"
#include "platform/transforms/AffineTransform.h"
#include "wtf/HashMap.h"
#include "wtf/Vector.h"
@@ -41,25 +40,36 @@ class SVGTextChunkBuilder {
public:
SVGTextChunkBuilder();
- const Vector<SVGTextChunk>& textChunks() const { return m_textChunks; }
void processTextChunks(const Vector<SVGInlineTextBox*>&);
void finalizeTransformMatrices(const Vector<SVGInlineTextBox*>&) const;
- void buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutBoxes);
- void layoutTextChunks(Vector<SVGInlineTextBox*>& lineLayoutBoxes);
+protected:
+ virtual void handleTextChunk(const Vector<SVGInlineTextBox*>&, unsigned boxStart, unsigned boxEnd);
f(malita) 2015/05/27 15:19:13 The first thing both impls do is create a chunk ba
fs 2015/05/27 15:28:07 I should probably have mentioned this somewhere, b
private:
- void addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxes, unsigned boxPosition, unsigned boxCount);
- void processTextChunk(const SVGTextChunk&);
-
void processTextLengthSpacingCorrection(bool isVerticalText, float textLengthShift, Vector<SVGTextFragment>&, unsigned& atCharacter);
void processTextAnchorCorrection(bool isVerticalText, float textAnchorShift, Vector<SVGTextFragment>&);
-private:
- Vector<SVGTextChunk> m_textChunks;
HashMap<SVGInlineTextBox*, AffineTransform> m_textBoxTransformations;
};
+class SVGTextPathChunkBuilder final : public SVGTextChunkBuilder {
+ WTF_MAKE_NONCOPYABLE(SVGTextPathChunkBuilder);
+public:
+ SVGTextPathChunkBuilder();
+
+ float totalLength() const { return m_totalLength; }
+ unsigned totalCharacters() const { return m_totalCharacters; }
+ float totalTextAnchorShift() const { return m_totalTextAnchorShift; }
+
+private:
+ void handleTextChunk(const Vector<SVGInlineTextBox*>&, unsigned boxStart, unsigned boxEnd) override;
+
+ float m_totalLength;
+ unsigned m_totalCharacters;
+ float m_totalTextAnchorShift;
+};
+
} // namespace blink
#endif
« no previous file with comments | « no previous file | Source/core/layout/svg/SVGTextChunkBuilder.cpp » ('j') | Source/core/layout/svg/SVGTextChunkBuilder.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698