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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.h

Issue 2718043003: Refactor InspectorCSSAgent to avoid an intermediate GlyphBuffer (Closed)
Patch Set: cleanup Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ShapeResultBuffer_h 5 #ifndef ShapeResultBuffer_h
6 #define ShapeResultBuffer_h 6 #define ShapeResultBuffer_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/fonts/shaping/ShapeResult.h" 9 #include "platform/fonts/shaping/ShapeResult.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
11 #include "wtf/RefPtr.h" 11 #include "wtf/RefPtr.h"
12 #include "wtf/Vector.h" 12 #include "wtf/Vector.h"
13 #include <tuple>
13 14
14 namespace blink { 15 namespace blink {
15 16
16 struct CharacterRange; 17 struct CharacterRange;
17 class GlyphBuffer; 18 class GlyphBuffer;
18 struct GlyphData; 19 struct GlyphData;
19 class TextRun; 20 class TextRun;
20 21
21 class PLATFORM_EXPORT ShapeResultBuffer { 22 class PLATFORM_EXPORT ShapeResultBuffer {
22 WTF_MAKE_NONCOPYABLE(ShapeResultBuffer); 23 WTF_MAKE_NONCOPYABLE(ShapeResultBuffer);
(...skipping 27 matching lines...) Expand all
50 unsigned to) const; 51 unsigned to) const;
51 Vector<CharacterRange> individualCharacterRanges(TextDirection, 52 Vector<CharacterRange> individualCharacterRanges(TextDirection,
52 float totalWidth) const; 53 float totalWidth) const;
53 54
54 static CharacterRange getCharacterRange(RefPtr<const ShapeResult>, 55 static CharacterRange getCharacterRange(RefPtr<const ShapeResult>,
55 TextDirection, 56 TextDirection,
56 float totalWidth, 57 float totalWidth,
57 unsigned from, 58 unsigned from,
58 unsigned to); 59 unsigned to);
59 60
61 struct RunFontData {
62 SimpleFontData* m_fontData;
63 size_t m_glyphCount;
64 };
65
66 Vector<RunFontData> runFontData() const;
67
60 private: 68 private:
61 static CharacterRange getCharacterRangeInternal( 69 static CharacterRange getCharacterRangeInternal(
62 const Vector<RefPtr<const ShapeResult>, 64>&, 70 const Vector<RefPtr<const ShapeResult>, 64>&,
63 TextDirection, 71 TextDirection,
64 float totalWidth, 72 float totalWidth,
65 unsigned from, 73 unsigned from,
66 unsigned to); 74 unsigned to);
67 75
68 float fillFastHorizontalGlyphBuffer(GlyphBuffer*, const TextRun&) const; 76 float fillFastHorizontalGlyphBuffer(GlyphBuffer*, const TextRun&) const;
69 77
(...skipping 19 matching lines...) Expand all
89 97
90 // Empirically, cases where we get more than 50 ShapeResults are extremely 98 // Empirically, cases where we get more than 50 ShapeResults are extremely
91 // rare. 99 // rare.
92 Vector<RefPtr<const ShapeResult>, 64> m_results; 100 Vector<RefPtr<const ShapeResult>, 64> m_results;
93 bool m_hasVerticalOffsets; 101 bool m_hasVerticalOffsets;
94 }; 102 };
95 103
96 } // namespace blink 104 } // namespace blink
97 105
98 #endif // ShapeResultBuffer_h 106 #endif // ShapeResultBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698