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

Unified Diff: ui/gfx/render_text_win.cc

Issue 8515012: Avoid unnecessary work in |RenderTextWin::UpdateLayout()| if there are no runs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_win.cc
===================================================================
--- ui/gfx/render_text_win.cc (revision 109436)
+++ ui/gfx/render_text_win.cc (working copy)
@@ -316,9 +316,11 @@
void RenderTextWin::UpdateLayout() {
// TODO(msw): Skip complex processing if ScriptIsComplex returns false.
ItemizeLogicalText();
- HDC hdc = CreateCompatibleDC(NULL);
- LayoutVisualText(hdc);
- DeleteDC(hdc);
+ if (!runs_.empty()) {
+ HDC hdc = CreateCompatibleDC(NULL);
sky 2011/11/10 21:49:04 nit: use ScopedCreateDC.
Alexei Svitkine (slow) 2011/11/10 22:10:35 Done.
+ LayoutVisualText(hdc);
+ DeleteDC(hdc);
+ }
}
size_t RenderTextWin::IndexOfAdjacentGrapheme(size_t index, bool next) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698