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

Side by Side Diff: ui/gfx/render_text_harfbuzz.cc

Issue 789583002: Updates subpixel positioning and hinting when DSF is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GN Created 6 years 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
« ui/gfx/font_render_params.h ('K') | « ui/gfx/platform_font_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/gfx/render_text_harfbuzz.h" 5 #include "ui/gfx/render_text_harfbuzz.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <map> 8 #include <map>
9 9
10 #include "base/i18n/bidi_line_iterator.h" 10 #include "base/i18n/bidi_line_iterator.h"
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 if (family == primary_family) 1155 if (family == primary_family)
1156 continue; 1156 continue;
1157 #if defined(OS_WIN) 1157 #if defined(OS_WIN)
1158 if (family == uniscribe_family) 1158 if (family == uniscribe_family)
1159 continue; 1159 continue;
1160 #endif 1160 #endif
1161 FontRenderParamsQuery query(false); 1161 FontRenderParamsQuery query(false);
1162 query.families.push_back(family); 1162 query.families.push_back(family);
1163 query.pixel_size = run->font_size; 1163 query.pixel_size = run->font_size;
1164 query.style = run->font_style; 1164 query.style = run->font_style;
1165 FontRenderParams fallback_render_params = GetFontRenderParams(query, NULL); 1165 FontRenderParams fallback_render_params =
1166 GetCurrentFontRenderParams(query, NULL);
1166 if (CompareFamily(run, family, fallback_render_params, &best_family, 1167 if (CompareFamily(run, family, fallback_render_params, &best_family,
1167 &best_render_params, &best_missing_glyphs)) 1168 &best_render_params, &best_missing_glyphs))
1168 return; 1169 return;
1169 } 1170 }
1170 1171
1171 if (!best_family.empty() && 1172 if (!best_family.empty() &&
1172 (best_family == run->family || 1173 (best_family == run->family ||
1173 ShapeRunWithFont(run, best_family, best_render_params))) 1174 ShapeRunWithFont(run, best_family, best_render_params)))
1174 return; 1175 return;
1175 1176
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 if (!run->render_params.subpixel_positioning) 1235 if (!run->render_params.subpixel_positioning)
1235 run->width = std::floor(run->width + 0.5f); 1236 run->width = std::floor(run->width + 0.5f);
1236 } 1237 }
1237 1238
1238 hb_buffer_destroy(buffer); 1239 hb_buffer_destroy(buffer);
1239 hb_font_destroy(harfbuzz_font); 1240 hb_font_destroy(harfbuzz_font);
1240 return true; 1241 return true;
1241 } 1242 }
1242 1243
1243 } // namespace gfx 1244 } // namespace gfx
OLDNEW
« ui/gfx/font_render_params.h ('K') | « ui/gfx/platform_font_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698