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

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

Issue 2835103002: Move blobalizer implementation to ShapeResultBloberizer (Closed)
Patch Set: Fix canvas tests Created 3 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 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 int CachingWordShaper::OffsetForPosition(const TextRun& run, 82 int CachingWordShaper::OffsetForPosition(const TextRun& run,
83 float target_x, 83 float target_x,
84 bool include_partial_glyphs) { 84 bool include_partial_glyphs) {
85 ShapeResultBuffer buffer; 85 ShapeResultBuffer buffer;
86 ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer); 86 ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer);
87 87
88 return buffer.OffsetForPosition(run, target_x, include_partial_glyphs); 88 return buffer.OffsetForPosition(run, target_x, include_partial_glyphs);
89 } 89 }
90 90
91 float CachingWordShaper::FillGlyphs(const TextRunPaintInfo& run_info, 91 void CachingWordShaper::FillResultBuffer(const TextRunPaintInfo& run_info,
92 ShapeResultBloberizer& bloberizer) { 92 ShapeResultBuffer* buffer) {
93 ShapeResultBuffer buffer; 93 DCHECK(buffer);
94 ShapeResultsForRun(GetShapeCache(), &font_, run_info.run, &buffer); 94 ShapeResultsForRun(GetShapeCache(), &font_, run_info.run, buffer);
95
96 return buffer.FillGlyphs(run_info, bloberizer);
97 }
98
99 void CachingWordShaper::FillTextEmphasisGlyphs(
100 const TextRunPaintInfo& run_info,
101 const GlyphData& emphasis_data,
102 ShapeResultBloberizer& bloberizer) {
103 ShapeResultBuffer buffer;
104 ShapeResultsForRun(GetShapeCache(), &font_, run_info.run, &buffer);
105
106 buffer.FillTextEmphasisGlyphs(run_info, emphasis_data, bloberizer);
107 } 95 }
108 96
109 CharacterRange CachingWordShaper::GetCharacterRange(const TextRun& run, 97 CharacterRange CachingWordShaper::GetCharacterRange(const TextRun& run,
110 unsigned from, 98 unsigned from,
111 unsigned to) { 99 unsigned to) {
112 ShapeResultBuffer buffer; 100 ShapeResultBuffer buffer;
113 float total_width = ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer); 101 float total_width = ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer);
114 102
115 return buffer.GetCharacterRange(run.Direction(), total_width, from, to); 103 return buffer.GetCharacterRange(run.Direction(), total_width, from, to);
116 } 104 }
(...skipping 22 matching lines...) Expand all
139 127
140 GlyphData CachingWordShaper::EmphasisMarkGlyphData( 128 GlyphData CachingWordShaper::EmphasisMarkGlyphData(
141 const TextRun& emphasis_mark_run) const { 129 const TextRun& emphasis_mark_run) const {
142 ShapeResultBuffer buffer; 130 ShapeResultBuffer buffer;
143 ShapeResultsForRun(GetShapeCache(), &font_, emphasis_mark_run, &buffer); 131 ShapeResultsForRun(GetShapeCache(), &font_, emphasis_mark_run, &buffer);
144 132
145 return buffer.EmphasisMarkGlyphData(font_.font_description_); 133 return buffer.EmphasisMarkGlyphData(font_.font_description_);
146 } 134 }
147 135
148 }; // namespace blink 136 }; // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698