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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp

Issue 2714413003: Remove GlyphBuffer (Closed)
Patch Set: format 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 /* 1 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 int CachingWordShaper::offsetForPosition(const TextRun& run, 83 int CachingWordShaper::offsetForPosition(const TextRun& run,
84 float targetX, 84 float targetX,
85 bool includePartialGlyphs) { 85 bool includePartialGlyphs) {
86 ShapeResultBuffer buffer; 86 ShapeResultBuffer buffer;
87 shapeResultsForRun(shapeCache(), &m_font, run, &buffer); 87 shapeResultsForRun(shapeCache(), &m_font, run, &buffer);
88 88
89 return buffer.offsetForPosition(run, targetX, includePartialGlyphs); 89 return buffer.offsetForPosition(run, targetX, includePartialGlyphs);
90 } 90 }
91 91
92 float CachingWordShaper::fillGlyphBuffer( 92 float CachingWordShaper::fillGlyphs(const TextRunPaintInfo& runInfo,
93 const TextRun& run, 93 ShapeResultBloberizer& bloberizer) {
94 GlyphBuffer* glyphBuffer,
95 unsigned from,
96 unsigned to) {
97 ShapeResultBuffer buffer; 94 ShapeResultBuffer buffer;
98 shapeResultsForRun(shapeCache(), &m_font, run, &buffer); 95 shapeResultsForRun(shapeCache(), &m_font, runInfo.run, &buffer);
99 96
100 return buffer.fillGlyphBuffer(glyphBuffer, run, from, to); 97 return buffer.fillGlyphs(runInfo, bloberizer);
101 } 98 }
102 99
103 float CachingWordShaper::fillGlyphBufferForTextEmphasis( 100 void CachingWordShaper::fillTextEmphasisGlyphs(
104 const TextRun& run, 101 const TextRunPaintInfo& runInfo,
105 const GlyphData* emphasisData, 102 const GlyphData& emphasisData,
106 GlyphBuffer* glyphBuffer, 103 ShapeResultBloberizer& bloberizer) {
107 unsigned from,
108 unsigned to) {
109 ShapeResultBuffer buffer; 104 ShapeResultBuffer buffer;
110 shapeResultsForRun(shapeCache(), &m_font, run, &buffer); 105 shapeResultsForRun(shapeCache(), &m_font, runInfo.run, &buffer);
111 106
112 return buffer.fillGlyphBufferForTextEmphasis(glyphBuffer, run, emphasisData, 107 buffer.fillTextEmphasisGlyphs(runInfo, emphasisData, bloberizer);
113 from, to);
114 } 108 }
115 109
116 CharacterRange CachingWordShaper::getCharacterRange(const TextRun& run, 110 CharacterRange CachingWordShaper::getCharacterRange(const TextRun& run,
117 unsigned from, 111 unsigned from,
118 unsigned to) { 112 unsigned to) {
119 ShapeResultBuffer buffer; 113 ShapeResultBuffer buffer;
120 float totalWidth = 114 float totalWidth =
121 shapeResultsForRun(shapeCache(), &m_font, run, &buffer); 115 shapeResultsForRun(shapeCache(), &m_font, run, &buffer);
122 116
123 return buffer.getCharacterRange(run.direction(), totalWidth, from, to); 117 return buffer.getCharacterRange(run.direction(), totalWidth, from, to);
(...skipping 24 matching lines...) Expand all
148 142
149 GlyphData CachingWordShaper::emphasisMarkGlyphData( 143 GlyphData CachingWordShaper::emphasisMarkGlyphData(
150 const TextRun& emphasisMarkRun) const { 144 const TextRun& emphasisMarkRun) const {
151 ShapeResultBuffer buffer; 145 ShapeResultBuffer buffer;
152 shapeResultsForRun(shapeCache(), &m_font, emphasisMarkRun, &buffer); 146 shapeResultsForRun(shapeCache(), &m_font, emphasisMarkRun, &buffer);
153 147
154 return buffer.emphasisMarkGlyphData(m_font.m_fontDescription); 148 return buffer.emphasisMarkGlyphData(m_font.m_fontDescription);
155 } 149 }
156 150
157 }; // namespace blink 151 }; // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698